forked from getdokan/dokan
-
Notifications
You must be signed in to change notification settings - Fork 1
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
25e512b
commit 49cde25
Showing
14 changed files
with
163 additions
and
183 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
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,95 +1,70 @@ | ||
import { test, Page } from '@playwright/test'; | ||
import { LoginPage } from '@pages/loginPage'; | ||
import { AdminPage } from '@pages/adminPage'; | ||
// import { ApiUtils } from '@utils/apiUtils'; | ||
import { TaxPage } from '@pages/taxPage'; | ||
import { ShippingPage } from '@pages/shippingPage'; | ||
import { data } from '@utils/testData'; | ||
// import { payloads } from '@utils/payloads'; | ||
|
||
test.describe('Admin user functionality test', () => { | ||
test.use(data.auth.noAuth); | ||
|
||
let loginPage: LoginPage; | ||
let page: Page; | ||
|
||
test.beforeAll(async ({ browser }) => { | ||
const context = await browser.newContext(); | ||
page = await context.newPage(); | ||
loginPage = new LoginPage(page); | ||
}); | ||
|
||
test.afterAll(async () => { | ||
await page.close(); | ||
}); | ||
|
||
test('admin can login @lite @a', async () => { | ||
await loginPage.adminLogin(data.admin); | ||
}); | ||
|
||
test('admin can logout @lite @a', async () => { | ||
await loginPage.adminLogin(data.admin); | ||
await loginPage.logoutBackend(); | ||
}); | ||
}); | ||
|
||
test.describe('Admin functionality test', () => { | ||
let adminPage: AdminPage; | ||
let taxPage: TaxPage; | ||
let shippingPage: ShippingPage; | ||
let aPage: Page; | ||
|
||
test.beforeAll(async ({ browser }) => { | ||
const adminContext = await browser.newContext(data.auth.adminAuth); | ||
aPage = await adminContext.newPage(); | ||
adminPage = new AdminPage(aPage); | ||
taxPage = new TaxPage(aPage); | ||
shippingPage = new ShippingPage(aPage); | ||
}); | ||
|
||
test.afterAll(async () => { | ||
await aPage.close(); | ||
}); | ||
|
||
// test('admin can add categories @lite', async ( ) => { | ||
// await adminPage.addCategory(data.product.category.randomCategory()); | ||
// }); | ||
test('admin can login @lite @a', async ({ page }) => { | ||
const loginPage = new LoginPage(page); | ||
await loginPage.adminLogin(data.admin); | ||
}); | ||
|
||
// test('admin can add attributes @lite', async ( ) => { | ||
// await adminPage.addAttributes(data.product.attribute.randomAttribute()); | ||
// }); | ||
test('admin can logout @lite @a', async ({ page }) => { | ||
const loginPage = new LoginPage(page); | ||
await loginPage.adminLogin(data.admin); | ||
await loginPage.logoutBackend(); | ||
}); | ||
|
||
// settings | ||
|
||
// tax settings | ||
// test('admin can set standard tax rate', async ( ) => { | ||
// await adminPage.addStandardTaxRate(data.tax) | ||
// }) | ||
|
||
// shipping settings | ||
// test('admin can set flat rate shipping', async ( ) => { | ||
// await adminPage.addShippingMethod(data.shipping.shippingMethods.flatRate); | ||
// }); | ||
test('admin can set standard tax rate @lite @a', async () => { | ||
await taxPage.addStandardTaxRate(data.tax); | ||
}); | ||
|
||
// test('admin can set free shipping', async ( ) => { | ||
// await adminPage.addShippingMethod(data.shipping.shippingMethods.freeShipping) | ||
// }) | ||
// shipping settings | ||
|
||
// test('admin can set local pickup shipping', async ( ) => { | ||
// await adminPage.addShippingMethod(data.shipping.shippingMethods.localPickup) | ||
// }) | ||
test.skip('admin can set flat rate shipping @lite @a', async () => { | ||
await shippingPage.addShippingMethod(data.shipping.shippingMethods.flatRate); | ||
}); | ||
|
||
// test('admin can set table rate shipping', async ( ) => { | ||
// await adminPage.addShippingMethod(data.shipping.shippingMethods.tableRateShipping) | ||
// }) | ||
test.skip('admin can set free shipping @lite @a', async () => { | ||
await shippingPage.addShippingMethod(data.shipping.shippingMethods.freeShipping); | ||
}); | ||
|
||
// test('admin can set distance rate shipping', async ( ) => { | ||
// await adminPage.addShippingMethod(data.shipping.shippingMethods.distanceRateShipping) | ||
// }) | ||
test.skip('admin can set local pickup shipping @lite @a', async () => { | ||
await shippingPage.addShippingMethod(data.shipping.shippingMethods.localPickup); | ||
}); | ||
|
||
// test('admin can set vendor shipping', async ( ) => { | ||
// await adminPage.addShippingMethod(data.shipping.shippingMethods.vendorShipping) | ||
// }) | ||
test.skip('admin can set table rate shipping @pro @a', async () => { | ||
await shippingPage.addShippingMethod(data.shipping.shippingMethods.tableRateShipping); | ||
}); | ||
|
||
test('dokan notice @lite @a', async () => { | ||
await adminPage.dokanNotice(); | ||
test.skip('admin can set distance rate shipping @pro @a', async () => { | ||
await shippingPage.addShippingMethod(data.shipping.shippingMethods.distanceRateShipping); | ||
}); | ||
|
||
test('dokan promotion @lite @a', async () => { | ||
await adminPage.dokanPromotion(); | ||
test.skip('admin can set vendor shipping @pro @a', async () => { | ||
await shippingPage.addShippingMethod(data.shipping.shippingMethods.vendorShipping); | ||
}); | ||
}); |
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,30 @@ | ||
import { test, Page } from '@playwright/test'; | ||
import { NoticeAndPromotionPage } from '@pages/noticeAndPromotionPage'; | ||
import { data } from '@utils/testData'; | ||
|
||
test.describe('Dokan pro feature promo test', () => { | ||
let admin: NoticeAndPromotionPage; | ||
let aPage: Page; | ||
|
||
test.beforeAll(async ({ browser }) => { | ||
const adminContext = await browser.newContext(data.auth.adminAuth); | ||
aPage = await adminContext.newPage(); | ||
admin = new NoticeAndPromotionPage(aPage); | ||
}); | ||
|
||
test.afterAll(async () => { | ||
await aPage.close(); | ||
}); | ||
|
||
test('dokan notice is rendering properly @lite @exp @a', async () => { | ||
await admin.dokanNoticeRenderProperly(); | ||
}); | ||
|
||
test('dokan promotion is rendering properly @lite @exp @a', async () => { | ||
await admin.dokanPromotionRenderProperly(); | ||
}); | ||
|
||
test('dokan pro features promotions are rendering properly @liteOnly @exp @a', async () => { | ||
await admin.dokanProPromotionRenderProperly(); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.