Skip to content

Commit

Permalink
playwright: refactoring for ignoreHTTPSErrors and parallel per file
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaosEngine committed Sep 24, 2022
1 parent 56ae901 commit a3be170
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions DotnetPlayground.Web/e2e/Anonymous.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { test, expect } from '@playwright/test';
* @param {string} pageUrl url to page
*/
async function notAllowedAndRedirecttoLogin(browser, pageUrl) {
const page = await browser.newPage({ ignoreHTTPSErrors: true });
const page = await browser.newPage();

page.goto(pageUrl);

Expand All @@ -22,11 +22,13 @@ async function notAllowedAndRedirecttoLogin(browser, pageUrl) {
await expect(body).toContainText(/Log in/);
}

test.describe.configure({ mode: 'parallel' });

test.describe('Logged in as Anonymous', () => {
test.use({ storageState: './e2e/storageStates/Anonymous-storageState.json' });
test.use({ storageState: './e2e/storageStates/Anonymous-storageState.json', ignoreHTTPSErrors: true });

test('Home as Anonymous', async ({ browser }) => {
const page = await browser.newPage({ ignoreHTTPSErrors: true });
const page = await browser.newPage();

page.goto('InkBall/Home');

Expand All @@ -51,7 +53,7 @@ test.describe('Logged in as Anonymous', () => {
});

test('NotExisting page as Anonymous with redirect to LogIn', async ({ browser }) => {
const page = await browser.newPage({ ignoreHTTPSErrors: true });
const page = await browser.newPage();

const resp = await page.goto('InkBall/NotExisting');

Expand Down

0 comments on commit a3be170

Please sign in to comment.