11// @ts -check
22
3- import { test as base } from '@playwright/test' ;
3+ import { test } from '@playwright/test' ;
44import { inputValues } from '@config' ;
55import { requireEnv } from '@utils/env.utils' ;
66import { createLogger } from '@utils/logger' ;
@@ -13,14 +13,14 @@ const logger = createLogger('Setup');
1313const magentoAdminUsername = requireEnv ( 'MAGENTO_ADMIN_USERNAME' ) ;
1414const magentoAdminPassword = requireEnv ( 'MAGENTO_ADMIN_PASSWORD' ) ;
1515
16- base . beforeEach ( async ( { page } , testInfo ) => {
16+ test . beforeEach ( async ( { page } , testInfo ) => {
1717 const magentoAdminPage = new MagentoAdminPage ( page ) ;
1818 await magentoAdminPage . login ( magentoAdminUsername , magentoAdminPassword ) ;
1919} ) ;
2020
21- base . describe ( 'Setting up the testing environment' , ( ) => {
21+ test . describe ( 'Setting up the testing environment' , ( ) => {
2222 // Set tests to serial mode to ensure the order is followed.
23- base . describe . configure ( { mode :'serial' } ) ;
23+ test . describe . configure ( { mode :'serial' } ) ;
2424
2525 /**
2626 * @feature Magento Admin Configuration (disable login CAPTCHA)
@@ -33,14 +33,13 @@ base.describe('Setting up the testing environment', () => {
3333 * @but if the browser is not Chromium
3434 * @then the test is skipped with an appropriate message
3535 */
36- base ( 'Disable_login_captcha' , { tag : '@setup' } , async ( { page, browserName } , testInfo ) => {
37- base . skip ( browserName !== 'chromium' , `Disabling login captcha through Chromium. This is ${ browserName } , therefore test is skipped.` ) ;
36+ test ( 'Disable_login_captcha' , { tag : '@setup' } , async ( { page, browserName } , testInfo ) => {
37+ test . skip ( browserName !== 'chromium' , `Disabling login captcha through Chromium. This is ${ browserName } , therefore test is skipped.` ) ;
3838
3939 const magentoAdminPage = new MagentoAdminPage ( page ) ;
4040 await magentoAdminPage . disableLoginCaptcha ( ) ;
4141 } ) ;
4242
43-
4443 /**
4544 * @feature Magento Admin Configuration (Enable multiple admin logins)
4645 * @scenario Enable multiple admin logins only in Chromium browser
@@ -54,13 +53,12 @@ base.describe('Setting up the testing environment', () => {
5453 * @but if the browser is not Chromium
5554 * @then the test is skipped with an appropriate message
5655 */
57- base ( 'Enable_multiple_admin_logins' , { tag : '@setup' } , async ( { page, browserName } , testInfo ) => {
58- base . skip ( browserName !== 'chromium' , `Disabling login captcha through Chromium. This is ${ browserName } , therefore test is skipped.` ) ;
56+ test ( 'Enable_multiple_admin_logins' , { tag : '@setup' } , async ( { page, browserName } , testInfo ) => {
57+ test . skip ( browserName !== 'chromium' , `Disabling login captcha through Chromium. This is ${ browserName } , therefore test is skipped.` ) ;
5958
6059 const magentoAdminPage = new MagentoAdminPage ( page ) ;
6160 await magentoAdminPage . enableMultipleAdminLogins ( ) ;
6261 } ) ;
63-
6462
6563 /**
6664 * @feature Cart Price Rules Configuration
@@ -70,7 +68,7 @@ base.describe('Setting up the testing environment', () => {
7068 * @and the admin creates a new cart price rule with the specified coupon code
7169 * @then the coupon code is successfully saved and available for use
7270 */
73- base ( 'Set_up_coupon_codes' , { tag : '@setup' } , async ( { page, browserName} , testInfo ) => {
71+ test ( 'Set_up_coupon_codes' , { tag : '@setup' } , async ( { page, browserName} , testInfo ) => {
7472 const magentoAdminPage = new MagentoAdminPage ( page ) ;
7573 const browserEngine = browserName ?. toUpperCase ( ) || "UNKNOWN" ;
7674 const couponCode = requireEnv ( `MAGENTO_COUPON_CODE_${ browserEngine } ` ) ;
@@ -87,14 +85,14 @@ base.describe('Setting up the testing environment', () => {
8785 * @and submits the registration form with first name, last name, email, and password
8886 * @then a new customer account is successfully created for testing purposes
8987 */
90- base ( 'Create_test_accounts' , { tag : '@setup' } , async ( { page, browserName} , testInfo ) => {
88+ test ( 'Create_test_accounts' , { tag : '@setup' } , async ( { page, browserName} , testInfo ) => {
9189 const magentoAdminPage = new MagentoAdminPage ( page ) ;
9290 const registerPage = new RegisterPage ( page ) ;
9391 const browserEngine = browserName ?. toUpperCase ( ) || "UNKNOWN" ;
9492 const accountEmail = requireEnv ( `MAGENTO_EXISTING_ACCOUNT_EMAIL_${ browserEngine } ` ) ;
9593 const accountPassword = requireEnv ( 'MAGENTO_EXISTING_ACCOUNT_PASSWORD' ) ;
9694
97- await base . step ( `Check if ${ accountEmail } is already registered` , async ( ) => {
95+ await test . step ( `Check if ${ accountEmail } is already registered` , async ( ) => {
9896 const customerLookUp = await magentoAdminPage . checkIfCustomerExists ( accountEmail ) ;
9997 if ( customerLookUp ) {
10098 testInfo . skip ( true , `${ accountEmail } was found in user table, this step is skipped. If you think this is incorrect, consider removing user from the table and try running the setup again.` ) ;
0 commit comments