diff --git a/.github/workflows/podcast-web.yml b/.github/workflows/podcast-web.yml index 74e5cc8..2c3314f 100644 --- a/.github/workflows/podcast-web.yml +++ b/.github/workflows/podcast-web.yml @@ -43,7 +43,7 @@ jobs: if: ${{ always() }} timeout-minutes: 60 runs-on: ubuntu-latest - container: mcr.microsoft.com/playwright:v1.27.1-focal + container: mcr.microsoft.com/playwright:v1.28.1-focal env: BASEURL: https://${{secrets.WEBAPP_NAME}}.azurewebsites.net # sets value for URL to test defaults: diff --git a/src/Web/E2E/package-lock.json b/src/Web/E2E/package-lock.json index bab9793..46a8746 100644 --- a/src/Web/E2E/package-lock.json +++ b/src/Web/E2E/package-lock.json @@ -9,17 +9,17 @@ "version": "1.0.0", "license": "ISC", "devDependencies": { - "@playwright/test": "^1.27.1" + "@playwright/test": "^1.28.1" } }, "node_modules/@playwright/test": { - "version": "1.27.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.27.1.tgz", - "integrity": "sha512-mrL2q0an/7tVqniQQF6RBL2saskjljXzqNcCOVMUjRIgE6Y38nCNaP+Dc2FBW06bcpD3tqIws/HT9qiMHbNU0A==", + "version": "1.28.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.28.1.tgz", + "integrity": "sha512-xN6spdqrNlwSn9KabIhqfZR7IWjPpFK1835tFNgjrlysaSezuX8PYUwaz38V/yI8TJLG9PkAMEXoHRXYXlpTPQ==", "dev": true, "dependencies": { "@types/node": "*", - "playwright-core": "1.27.1" + "playwright-core": "1.28.1" }, "bin": { "playwright": "cli.js" @@ -35,9 +35,9 @@ "dev": true }, "node_modules/playwright-core": { - "version": "1.27.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.27.1.tgz", - "integrity": "sha512-9EmeXDncC2Pmp/z+teoVYlvmPWUC6ejSSYZUln7YaP89Z6lpAaiaAnqroUt/BoLo8tn7WYShcfaCh+xofZa44Q==", + "version": "1.28.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.28.1.tgz", + "integrity": "sha512-3PixLnGPno0E8rSBJjtwqTwJe3Yw72QwBBBxNoukIj3lEeBNXwbNiKrNuB1oyQgTBw5QHUhNO3SteEtHaMK6ag==", "dev": true, "bin": { "playwright": "cli.js" @@ -49,13 +49,13 @@ }, "dependencies": { "@playwright/test": { - "version": "1.27.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.27.1.tgz", - "integrity": "sha512-mrL2q0an/7tVqniQQF6RBL2saskjljXzqNcCOVMUjRIgE6Y38nCNaP+Dc2FBW06bcpD3tqIws/HT9qiMHbNU0A==", + "version": "1.28.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.28.1.tgz", + "integrity": "sha512-xN6spdqrNlwSn9KabIhqfZR7IWjPpFK1835tFNgjrlysaSezuX8PYUwaz38V/yI8TJLG9PkAMEXoHRXYXlpTPQ==", "dev": true, "requires": { "@types/node": "*", - "playwright-core": "1.27.1" + "playwright-core": "1.28.1" } }, "@types/node": { @@ -65,9 +65,9 @@ "dev": true }, "playwright-core": { - "version": "1.27.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.27.1.tgz", - "integrity": "sha512-9EmeXDncC2Pmp/z+teoVYlvmPWUC6ejSSYZUln7YaP89Z6lpAaiaAnqroUt/BoLo8tn7WYShcfaCh+xofZa44Q==", + "version": "1.28.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.28.1.tgz", + "integrity": "sha512-3PixLnGPno0E8rSBJjtwqTwJe3Yw72QwBBBxNoukIj3lEeBNXwbNiKrNuB1oyQgTBw5QHUhNO3SteEtHaMK6ag==", "dev": true } } diff --git a/src/Web/E2E/package.json b/src/Web/E2E/package.json index 402dc70..e557bc1 100644 --- a/src/Web/E2E/package.json +++ b/src/Web/E2E/package.json @@ -19,6 +19,6 @@ }, "homepage": "https://github.com/Microsoft/dotnet-podcasts#readme", "devDependencies": { - "@playwright/test": "^1.27.1" + "@playwright/test": "^1.28.1" } } diff --git a/src/Web/E2E/tests/discover.spec.ts b/src/Web/E2E/tests/discover.spec.ts index 46fcf9f..e8c5f96 100644 --- a/src/Web/E2E/tests/discover.spec.ts +++ b/src/Web/E2E/tests/discover.spec.ts @@ -10,7 +10,7 @@ test.describe('Discover', () => { for (const category of categories) { test(`should allow me to browse category ${category}`, async ({ page }) => { // click on the category - await page.locator('.tags-item').getByText(category).click(); + await page.getByRole('list').getByRole('link', { name: category }).click(); // assert category is selected await expect(page.locator('.titlePage')).toHaveText(category); }); diff --git a/src/Web/E2E/tests/listen-later.spec.ts b/src/Web/E2E/tests/listen-later.spec.ts index 275eb5a..822fd7a 100644 --- a/src/Web/E2E/tests/listen-later.spec.ts +++ b/src/Web/E2E/tests/listen-later.spec.ts @@ -8,9 +8,9 @@ test.describe('Listen Later', () => { // click first listen later button await page.locator('button.buttonIcon.episode-actions-later').first().click(); // view listen later tab - await page.locator('.navbarApp-item >> text=ListenLater').click(); + await page.getByRole('link', { name: 'Listen Later' }).click(); await expect(page).toHaveURL('/listen-later'); // 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'); }); }); \ No newline at end of file diff --git a/src/Web/E2E/tests/listen-together.spec.ts b/src/Web/E2E/tests/listen-together.spec.ts index 30aebd2..1c834c9 100644 --- a/src/Web/E2E/tests/listen-together.spec.ts +++ b/src/Web/E2E/tests/listen-together.spec.ts @@ -8,16 +8,14 @@ test.describe('Listen Together', () => { // click play await page.locator('.icon-play').first().click(); // click go to listen together page - await page.locator('text=ListenTogether').click(); + await page.getByRole('link', { name: 'Listen Together' }).click(); await expect(page).toHaveURL('/listen-together'); - // assert Create new room button isn't disabled - await expect(page.locator('.buttonApp.primary >> text=Create new room')).toBeEnabled() // create new room - await page.locator('.buttonApp.primary >> text=Create new room').click(); + await page.getByRole('button', { name: 'Create new room' }).click(); await page.getByPlaceholder('Your name').fill('test'); // open room - await page.locator('button:has-text("Open room")').click(); + await page.getByRole('button', { name: 'Open room' }).click(); // leave the room - await page.getByRole('button', { name: 'Leave the room' }).click(); + await page.getByRole('button', { name: 'Leave the room' }).click(); }); }); \ No newline at end of file diff --git a/src/Web/E2E/tests/login.spec.ts b/src/Web/E2E/tests/login.spec.ts index 3a07cf8..05d8f10 100644 --- a/src/Web/E2E/tests/login.spec.ts +++ b/src/Web/E2E/tests/login.spec.ts @@ -4,7 +4,7 @@ test.describe('Login', () => { test('should allow me to login', async ({ page }) => { await page.goto(''); // click sign in - await page.locator('text=Sign In').click(); + await page.getByRole('link', { name: 'Sign In' }).click(); // assert discover page is shown await expect(page).toHaveURL('/discover'); await expect(page).toHaveTitle('.NET Podcasts') diff --git a/src/Web/E2E/tests/subscriptions.spec.ts b/src/Web/E2E/tests/subscriptions.spec.ts index 153b8e8..d0af12e 100644 --- a/src/Web/E2E/tests/subscriptions.spec.ts +++ b/src/Web/E2E/tests/subscriptions.spec.ts @@ -6,7 +6,7 @@ test.describe('Subscriptions', () => { // click first podcast in list await page.locator('.item-primary-action').first().click(); // click subscribe - await page.getByRole('button', { name: ' Subscribe' }).click(); + await page.getByRole('button', { name: 'Subscribe' }).click(); // view subscriptions await page.getByRole('link', { name: 'Subscriptions' }).click(); await expect(page).toHaveURL('/subscriptions');