Skip to content

Commit

Permalink
add test for megadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Aibono1225 committed Jan 11, 2024
1 parent 0c82b45 commit 6ca1722
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/megadata.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// @ts-check
const { test, expect } = require('@playwright/test');

const baseurl = 'https://ssw.com.au/rules';

test('should have history.json', async ({ request }) => {
const response = await request.get(`${baseurl}/history.json`);
expect(response.status()).toBe(200);
});

test('should have megadata', async ({ page }) => {
await page.goto('https://ssw.com.au/rules/latest-rules/?size=50');

let randomNum = Math.floor(Math.random() * 50);

const ruleLink = await page
.locator('.cat-grid-container')
.getByRole('link')
.nth(randomNum);

await ruleLink.click();

const locator = page.locator('.history');
await expect(locator).toContainText('See history');
});

0 comments on commit 6ca1722

Please sign in to comment.