Skip to content

Commit

Permalink
Switched to test context
Browse files Browse the repository at this point in the history
  • Loading branch information
bmingles committed Nov 22, 2023
1 parent dd34f09 commit 293d4bf
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/styleguide.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const EXPECTED_BUTTON_SECTION_COUNT = 4;
const sampleSectionIds: string[] = [];
const buttonSectionIds: string[] = [];

test.beforeAll(async ({ browser }) => {
const page = await browser.newPage();
test.beforeAll(async ({ context }) => {
const page = await context.newPage();

await page.goto('/ide/styleguide');

Expand Down Expand Up @@ -39,9 +39,9 @@ test.beforeAll(async ({ browser }) => {
});

// Iterate over all sample sections and take a screenshot of each one.
test('UI regression test - Styleguide sections', async ({ browser }) => {
test('UI regression test - Styleguide sections', async ({ context }) => {
for (let i = 0; i < sampleSectionIds.length; i += 1) {
const page = await browser.newPage();
const page = await context.newPage();

const id = sampleSectionIds[i];

Expand All @@ -59,12 +59,12 @@ test('UI regression test - Styleguide sections', async ({ browser }) => {
}
});

test('Buttons regression test', async ({ browser }) => {
test('Buttons regression test', async ({ context }) => {
expect(buttonSectionIds.length).toEqual(EXPECTED_BUTTON_SECTION_COUNT);

// Test focus and hover states for each enabled button
for (let i = 0; i < buttonSectionIds.length; i += 1) {
const page = await browser.newPage();
const page = await context.newPage();

const id = buttonSectionIds[i];

Expand Down Expand Up @@ -114,7 +114,7 @@ test('Buttons regression test', async ({ browser }) => {
}
});

test('Inputs regression test', async ({ browser, page }) => {
test('Inputs regression test', async ({ page }) => {
await page.goto('/ide/styleguide?isolateSection=true#sample-section-inputs');

const columns = page.locator('#sample-section-inputs .col');
Expand Down

0 comments on commit 293d4bf

Please sign in to comment.