forked from PrestaShop/PrestaShop
-
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.
- Loading branch information
1 parent
1e78430
commit d1522f4
Showing
1 changed file
with
103 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
import {expect} from 'chai'; | ||
import testContext from '@utils/testContext'; | ||
import preferencesPage from '@pages/BO/shipping/preferences'; | ||
|
||
import { | ||
boDashboardPage, | ||
boLoginPage, | ||
boCarriersPage, | ||
boCarriersCreatePage, | ||
type BrowserContext, | ||
type Page, | ||
utilsPlaywright, | ||
} from '@prestashop-core/ui-testing'; | ||
|
||
const baseContext: string = 'audit_BO_shipping'; | ||
|
||
describe('BO - Shipping', async () => { | ||
let browserContext: BrowserContext; | ||
let page: Page; | ||
|
||
before(async function () { | ||
utilsPlaywright.setErrorsCaptured(true); | ||
|
||
browserContext = await utilsPlaywright.createBrowserContext(this.browser); | ||
page = await utilsPlaywright.newTab(browserContext); | ||
}); | ||
|
||
after(async () => { | ||
await utilsPlaywright.closeBrowserContext(browserContext); | ||
}); | ||
|
||
it('should login in BO', async function () { | ||
await testContext.addContextItem(this, 'testIdentifier', 'loginBO', baseContext); | ||
|
||
await boLoginPage.goTo(page, global.BO.URL); | ||
await boLoginPage.successLogin(page, global.BO.EMAIL, global.BO.PASSWD); | ||
|
||
const pageTitle = await boDashboardPage.getPageTitle(page); | ||
expect(pageTitle).to.contains(boDashboardPage.pageTitle); | ||
|
||
const jsErrors = utilsPlaywright.getJsErrors(); | ||
expect(jsErrors.length).to.equals(0); | ||
}); | ||
|
||
it('should go to \'Shipping > Carriers\' page', async function () { | ||
await testContext.addContextItem(this, 'testIdentifier', 'goToShippingCarriersPage', baseContext); | ||
|
||
await boDashboardPage.goToSubMenu( | ||
page, | ||
boDashboardPage.shippingLink, | ||
boDashboardPage.carriersLink, | ||
); | ||
await boCarriersPage.closeSfToolBar(page); | ||
|
||
const pageTitle = await boCarriersPage.getPageTitle(page); | ||
expect(pageTitle).to.contains(boCarriersPage.pageTitle); | ||
|
||
const jsErrors = utilsPlaywright.getJsErrors(); | ||
expect(jsErrors.length).to.equals(0); | ||
}); | ||
|
||
it('should go to add new carrier page', async function () { | ||
await testContext.addContextItem(this, 'testIdentifier', 'goToAddCarrierPage', baseContext); | ||
|
||
await boCarriersPage.goToAddNewCarrierPage(page); | ||
|
||
const pageTitle = await boCarriersCreatePage.getPageTitle(page); | ||
expect(pageTitle).to.contains(boCarriersCreatePage.pageTitleCreate); | ||
|
||
const jsErrors = utilsPlaywright.getJsErrors(); | ||
expect(jsErrors.length).to.equals(0); | ||
}); | ||
|
||
it('should return to \'Shipping > Carriers\' page', async function () { | ||
await testContext.addContextItem(this, 'testIdentifier', 'goBackToShippingCarriersPage', baseContext); | ||
|
||
await boCarriersCreatePage.goToPreviousPage(page); | ||
|
||
const pageTitle = await boCarriersPage.getPageTitle(page); | ||
expect(pageTitle).to.contains(boCarriersPage.pageTitle); | ||
|
||
const jsErrors = utilsPlaywright.getJsErrors(); | ||
expect(jsErrors.length).to.equals(0); | ||
|
||
}); | ||
|
||
it('should go to \'Shipping > Preferences\' page', async function () { | ||
await testContext.addContextItem(this, 'testIdentifier', 'goToShippingPreferencesPage', baseContext); | ||
|
||
await boDashboardPage.goToSubMenu( | ||
page, | ||
boDashboardPage.shippingLink, | ||
boDashboardPage.shippingPreferencesLink, | ||
); | ||
|
||
const pageTitle = await preferencesPage.getPageTitle(page); | ||
expect(pageTitle).to.contains(preferencesPage.pageTitle); | ||
|
||
const jsErrors = utilsPlaywright.getJsErrors(); | ||
expect(jsErrors.length).to.equals(0); | ||
}); | ||
}); | ||
|