format
parent
c210dd8040
commit
3de0e51056
|
@ -9,10 +9,10 @@ test.describe('Discover', () => {
|
||||||
const categories = ['Microsoft', 'Mobile', 'Community', 'M365'];
|
const categories = ['Microsoft', 'Mobile', 'Community', 'M365'];
|
||||||
for (const category of categories) {
|
for (const category of categories) {
|
||||||
test(`should allow me to browse category ${category}`, async ({ page }) => {
|
test(`should allow me to browse category ${category}`, async ({ page }) => {
|
||||||
// click on the category
|
// click on the category
|
||||||
await page.getByRole('list').getByRole('link', { name: category }).click();
|
await page.getByRole('list').getByRole('link', { name: category }).click();
|
||||||
// assert category is selected
|
// assert category is selected
|
||||||
await expect(page.locator('.titlePage')).toHaveText(category);
|
await expect(page.locator('.titlePage')).toHaveText(category);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,6 @@ test.describe('Listen Later', () => {
|
||||||
await page.getByRole('link', { name: 'Listen Later' }).click();
|
await page.getByRole('link', { name: 'Listen Later' }).click();
|
||||||
await expect(page).toHaveURL('/listen-later');
|
await expect(page).toHaveURL('/listen-later');
|
||||||
// assert no results page isn't shown
|
// assert no results page isn't shown
|
||||||
await expect(page.locator('main')).not.toContainText('no results');
|
await expect(page.locator('main')).not.toContainText('no results');
|
||||||
});
|
});
|
||||||
});
|
});
|
|
@ -14,8 +14,8 @@ test.describe('Listen Together', () => {
|
||||||
await page.getByRole('button', { name: 'Create new room' }).click();
|
await page.getByRole('button', { name: 'Create new room' }).click();
|
||||||
await page.getByPlaceholder('Your name').fill('test');
|
await page.getByPlaceholder('Your name').fill('test');
|
||||||
// open room
|
// open room
|
||||||
await page.getByRole('button', { name: 'Open room' }).click();
|
await page.getByRole('button', { name: 'Open room' }).click();
|
||||||
// leave the room
|
// leave the room
|
||||||
await page.getByRole('button', { name: 'Leave the room' }).click();
|
await page.getByRole('button', { name: 'Leave the room' }).click();
|
||||||
});
|
});
|
||||||
});
|
});
|
|
@ -7,11 +7,11 @@ test.beforeEach(async ({ page }) => {
|
||||||
test.describe('Settings', () => {
|
test.describe('Settings', () => {
|
||||||
// Loop through each setting
|
// Loop through each setting
|
||||||
const settings = ['autodownload', 'deleteplayed', 'systemtheme', 'darktheme'];
|
const settings = ['autodownload', 'deleteplayed', 'systemtheme', 'darktheme'];
|
||||||
for (const setting of settings) {
|
for (const setting of settings) {
|
||||||
test(`should allow me to toggle setting ${setting}`, async ({ page }) => {
|
test(`should allow me to toggle setting ${setting}`, async ({ page }) => {
|
||||||
// toggle setting
|
// toggle setting
|
||||||
await page.locator(`input[name="${setting}"]`).check();
|
await page.locator(`input[name="${setting}"]`).check();
|
||||||
await page.locator(`input[name="${setting}"]`).uncheck();
|
await page.locator(`input[name="${setting}"]`).uncheck();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
Loading…
Reference in New Issue