forked from chocolatey/choco-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(chocolatey#410) Update paths for Playwright Imports
This updates the paths to imports done in Playwright tests to reflect the correct location.
- Loading branch information
Showing
8 changed files
with
67 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
playwright/tests/pricing-calculator/add-on-standard-support.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,43 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { test, expect, Page } from '@playwright/test'; | ||
|
||
test('test-modals', async ({ page }) => { | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto('./'); | ||
}); | ||
|
||
const testModal = async (page: Page, locator: string, showContactLink: boolean) => { | ||
await page.click(`[data-bs-target="${locator}"]`); | ||
|
||
await page.locator('body.modal-open').waitFor(); | ||
|
||
await expect(page.locator(locator)).toBeVisible(); | ||
|
||
if (showContactLink) { | ||
await expect(page.locator(`${locator} .modal-footer a`)).toContainText('Contact Us'); | ||
} | ||
|
||
await page.locator(`${locator} .modal-footer button[data-bs-dismiss="modal"]`).click(); | ||
|
||
await page.locator(locator).waitFor({ state: 'hidden' }); | ||
|
||
await expect(page.locator(locator)).toBeHidden(); | ||
}; | ||
|
||
test('test-modals - #c4bModalPerpetualPricing', async ({ page }) => { | ||
await testModal(page, '#c4bModalPerpetualPricing', true); | ||
}); | ||
|
||
test('test-modals - #c4bModalNonProfitPricing', async ({ page }) => { | ||
await testModal(page, '#c4bModalNonProfitPricing', true); | ||
}); | ||
|
||
test('test-modals - #c4bModalPackaging', async ({ page }) => { | ||
await testModal(page, '#c4bModalPackaging', false); | ||
}); | ||
|
||
test('test-modals - #c4bModalResponseTimes', async ({ page }) => { | ||
await testModal(page, '#c4bModalResponseTimes', false); | ||
}); | ||
|
||
const perpetualModal = '#c4bModalPerpetualPricing'; | ||
const nonProfitModal = '#c4bModalNonProfitPricing'; | ||
const packagingModal = '#c4bModalPackaging'; | ||
const responseTimesModal = '#c4bModalResponseTimes'; | ||
const supportTypeModal = '#c4bModalSupportType'; | ||
|
||
const testModal = async (locator: string, showContactLink: boolean) => { | ||
await page.click(`[data-bs-target="${locator}"]`); | ||
await expect(page.locator(locator)).toBeVisible(); | ||
|
||
if (showContactLink) { | ||
await expect(page.locator(`${locator} .modal-footer a`)).toContainText('Contact Us'); | ||
} | ||
|
||
await page.locator(`${locator} .modal-footer button[data-bs-dismiss="modal"]`).click(); | ||
await expect(page.locator(locator)).toBeHidden(); | ||
}; | ||
|
||
await testModal(perpetualModal, true); | ||
await testModal(nonProfitModal, true); | ||
await testModal(packagingModal, false); | ||
await testModal(responseTimesModal, false); | ||
await testModal(supportTypeModal, false); | ||
test('test-modals - #c4bModalSupportType', async ({ page }) => { | ||
await testModal(page, '#c4bModalSupportType', false); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.