Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Automation] WPUF-lite: e2e testing for Login, Setup, PostForms and RegistrationForms #1365

Open
wants to merge 118 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
2fabb29
Updated Test/e2e
Feb 2, 2023
831f0a1
Updated yml
Feb 2, 2023
85538bd
Updated yml
Feb 2, 2023
eba7c46
Updated Config
Feb 2, 2023
0d0f66e
Updated 0011
Feb 2, 2023
74447fa
Updated 00001
Feb 2, 2023
54dae6a
Updated 00002
Feb 2, 2023
90c533b
Updated 00003
Feb 2, 2023
eefe292
Updated 00004
Feb 2, 2023
975a5d5
Updated 00004 - Checking Lite
Feb 2, 2023
4634d1c
Updated 00005
Feb 2, 2023
8a5f44a
Updated 00006
Feb 2, 2023
536758a
Updated 00007
Feb 2, 2023
5125e69
Updated 00008
Feb 7, 2023
a652a5b
Updated 00009
Feb 7, 2023
af4678b
Updated 00009 - updated Script number
Feb 7, 2023
1b3c9da
Update yml for GitAction
Feb 15, 2023
3e86ba3
Update yml for GitAction 001
Feb 15, 2023
e3f917a
Update yml for GitAction 002
Feb 15, 2023
e25407d
Merge branch 'weDevsOfficial:develop' into automation/wpuf-e2e-pw
Rat01047 Feb 15, 2023
c5abe3f
WPUF Lite + Pro > Test 0001
Apr 4, 2023
dd92b76
WPUF Lite Updated > Test 0003
Apr 4, 2023
0eac335
WPUF Lite Updated > Test 0004
Apr 4, 2023
9fbc7b9
WPUF Lite Updated > Test 0005
Apr 4, 2023
2870338
WPUF Lite Updated > Test 0006
Apr 4, 2023
9b3324e
WPUF Lite Updated > Test 0007
Apr 4, 2023
d27b902
WPUF Lite Updated > Test 0008
Apr 4, 2023
77d0c80
WPUF Lite Updated > Test 0009
Apr 4, 2023
19a0195
WPUF Lite Updated > Test 00010
Apr 5, 2023
908c280
WPUF Lite Updated > Test 00011
Apr 5, 2023
9ec9722
WPUF Lite Updated > Test 00012
Apr 17, 2023
9c6ea83
WPUF Lite Updated > Test 00014
Apr 18, 2023
8a60c24
WPUF Lite Updated > Test 00015
Apr 18, 2023
46ebd4a
Updated File Naming
May 8, 2023
49a7bd5
Updated .env data
May 8, 2023
1ec9446
Updated .env data for Login
May 8, 2023
715da58
Updated .env data for Login in multiple files
May 9, 2023
516bef9
Updated Post Forms Scripts
May 9, 2023
6071424
Updated Post Forms Scripts v1
May 9, 2023
7c6af6b
Updated Scripts and Faker Data
May 9, 2023
ac57440
Formattted Scripts
May 11, 2023
3c5920b
Formattted Scripts for Run: 0001
May 11, 2023
139d5e7
Formattted Scripts for Run: 0002
May 11, 2023
4b58ef7
Formattted Scripts for Run: 0003
May 11, 2023
bd2fbc6
Formattted Scripts for Run: 0004
May 12, 2023
ced4808
Formattted Scripts for Run: 0005
May 16, 2023
d51974f
Formattted Scripts for Run: 0006
May 16, 2023
4ef740b
Formattted Scripts for Run: 0007
May 16, 2023
c72c805
Formattted Scripts for Run: 0009
May 16, 2023
db6fbba
Formattted Scripts for Run: 00010
May 16, 2023
fb425e8
Formattted Scripts for Run: 00011
May 16, 2023
6c15972
Debugging url issue
May 16, 2023
893614d
Moved all Selectors to 1 file + remove extra folders
May 23, 2023
4d8b876
Resolved issues in yml PW
May 23, 2023
4a40995
Resolved issues in yml PW and updated ReadMe
May 23, 2023
9e9b3ce
Resolved issue for Blank form with all Fields validation
May 23, 2023
3aa24cb
Resolved issue for Blank form with all Fields validation
May 23, 2023
e659cba
Updated file paths
May 23, 2023
a4bfaa9
Integrated Scenarios for WPUF RegForm Check + RegForm FrontEnd Submis…
Jun 9, 2023
770dd7d
Updated package.json project name
Jun 9, 2023
8471295
Updated to an older version
Jun 9, 2023
ee715d9
Updated Registration Test Scenarios again
Jun 9, 2023
4dacae0
Run Full suite - 0001
Jun 9, 2023
150b7a2
Run Full suite - 0001
Jun 9, 2023
6d46ab2
Run Full suite - 0002
Jun 9, 2023
90ba98c
Run Full suite - 0003
Jun 9, 2023
ae14667
Added Promise to all + Added New User addition + added PostForm FE Su…
Jun 13, 2023
862ce6d
Updated yml
Jun 13, 2023
62ef150
Updated codebase for Failed cases
Jun 14, 2023
afbdc34
Updated Case 0018 and Case 0008
Jun 14, 2023
33711cb
Updated Case 0018 and Case 0008 - changed flow
Jun 14, 2023
3ffd1c2
Updated Case 0018 and Case 0008 - changed flow v2
Jun 14, 2023
781332f
Updated Case 0018 and Case 0008 - changed flow v3
Jun 14, 2023
1b4850a
Updated Case 0018 and Case 0008 - changed flow v4
Jun 14, 2023
12cc065
Updated Case 0018 and Case 0008 - changed flow v5
Jun 14, 2023
5267dd1
Updated Case 0018 and Case 0008 - changed flow v6
Jun 14, 2023
bcf7b98
Revamp of Test suites
Jun 20, 2023
4758c0f
Revamp of Test suites 001
Jun 20, 2023
eb52a52
Revamp of Test suites 002
Jun 20, 2023
49806b5
Revamp of Test suites 003
Jun 20, 2023
6e0439d
Revamp of Test suites 005
Jun 21, 2023
ebf1ce0
Revamp of Test suites 006
Jun 21, 2023
1bd15b7
Revamp of Test suites 007
Jun 21, 2023
c0e2864
Revamp of Test suites 008
Jun 21, 2023
cf8d575
Revamp of Test suites 009
Jun 21, 2023
5ef08d4
Revamp of Test suites 0010
Jun 21, 2023
7ff7d8f
Revamp of Test suites 0011
Jun 21, 2023
ffa63b0
Revamp of Test suites 0012
Jun 21, 2023
906b3b7
Update README.md
Rat01047 Jun 21, 2023
6cfdd79
Update README.md
Rat01047 Jun 21, 2023
310e2bf
Update README.md
Rat01047 Jun 21, 2023
d79ad1c
Update README.md
Rat01047 Jun 21, 2023
f77fbb3
Update README.md
Rat01047 Jun 21, 2023
24420d0
Update README.md
Rat01047 Jun 21, 2023
f4f158e
Update README.md
Rat01047 Jun 21, 2023
f505752
Update README.md
Rat01047 Jun 21, 2023
f77e850
Update README.md
Rat01047 Jun 21, 2023
7041bd7
Update README.md
Rat01047 Jun 21, 2023
d227318
Update README.md
Rat01047 Jun 21, 2023
dea271c
Update README.md
Rat01047 Jun 21, 2023
ee75b50
Revamp of Test suites 0013
Jun 22, 2023
b057613
Revamp of Test suites 0014
Jun 26, 2023
5d6643c
Revamp of Test suites 0015
Jul 6, 2023
8099029
Revamp of Test suites 0016
Jul 13, 2023
a3ce253
Update README.md
Rat01047 Jul 21, 2023
3a52672
Update README.md
Rat01047 Jul 21, 2023
91e154d
Update README.md
Rat01047 Jul 21, 2023
c78495f
Updated registrationform page creation using shortcode
Aug 3, 2023
29619c2
Merge branch 'automation/wpuf-e2e-pw' of https://github.com/Rat01047/…
Aug 3, 2023
b7c972d
Updated locators
Aug 3, 2023
6a0ddee
Updated Suite with some formats
Feb 12, 2024
6294a78
Updated Suite and reran tests
Feb 12, 2024
e98a1e7
resolved package-lock.json issue
Feb 13, 2024
4893a9d
Reran WPUF-lite test suite
Feb 13, 2024
a0b3205
Added Subscription Scenario
Feb 28, 2024
482b9b3
Revamped data-set
Mar 27, 2024
2ecea9f
Updated project details - v1
May 2, 2024
1cd1439
Added coverage
Aug 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WPUF Lite Updated > Test 0003
Nurul Amin Ratul authored and Nurul Amin Ratul committed Apr 4, 2023
commit dd92b766e87598253d37ff0169e4cedbab9db82f
40 changes: 20 additions & 20 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -30,13 +30,13 @@ jobs:
node-version: '14.x'


- name: Clone WPUF-pro
uses: actions/checkout@v3
with:
repository: weDevsOfficial/wpuf-pro
token: ${{ secrets.ACCESS_TOKEN }}
path: 'plugins/wpuf-pro'
ref: 'develop'
# - name: Clone WPUF-pro
# uses: actions/checkout@v3
# with:
# repository: weDevsOfficial/wpuf-pro
# token: ${{ secrets.ACCESS_TOKEN }}
# path: 'plugins/wpuf-pro'
# ref: 'develop'

- name: Composer install and build (WPUF-lite)
run: |
@@ -50,20 +50,20 @@ jobs:
grunt release


- name: Composer install and build (WPUF-pro)
run: |
cd plugins/wpuf-pro
composer config allow-plugins.composer/installers true
composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer update
composer install
composer dump-autoload -o
# - name: Composer install and build (WPUF-pro)
# run: |
# cd plugins/wpuf-pro
# composer config allow-plugins.composer/installers true
# composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
# composer update
# composer install
# composer dump-autoload -o

- name: Npm install and build (WPUF-pro)
run: |
cd plugins/wpuf-pro
npm i
grunt default
# - name: Npm install and build (WPUF-pro)
# run: |
# cd plugins/wpuf-pro
# npm i
# grunt default


- name: Install dependencies
13 changes: 11 additions & 2 deletions tests/e2e/pages/01_Basic/basicLogin.ts
Original file line number Diff line number Diff line change
@@ -111,14 +111,23 @@ export class BasicLoginPage {
*
*
*/
async pluginStatusCheck() {
async pluginStatusCheck_Lite_Activate() {
await this.page.goto('http://localhost:8889/wp-admin/');

//Plugin Status Check
//Activate Lite
await this.activate_WPUF_Lite();
};


async pluginStatusCheck_Pro_Activate() {
await this.page.goto('http://localhost:8889/wp-admin/');

//Activate Pro
await this.activate_WPUF_Pro();
};



async pluginVisit() {
await this.page.goto('http://localhost:8889/wp-admin/');
await this.page.click(Selectors_LoginPage.basicNavigation.clickWPUFSidebar);
212 changes: 132 additions & 80 deletions tests/e2e/pages/02_PostForms/postForms_Create.ts
Original file line number Diff line number Diff line change
@@ -177,27 +177,47 @@ export class PostForms_Create {
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsEmailAddress);
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsHiddenField);
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsImageUpload);

//From_PRO
//RepeatField
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsRepeatField);
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsDateTime);
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsTimeField);
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsFileUpload);
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsCountryList);
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsNumericField);
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsPhoneField);
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsAddressField);
const Check_Pro_Pop_UP = await this.page.isVisible(Selectors_PF_Create.add_CustomFields_PF.check_Pro_Pop_UP);
if (Check_Pro_Pop_UP === true) {
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.check_Pro_Pop_UP);
console.log("WPUF Pro is requred...")
}
else {
//DateTime
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsDateTime);
//TimeField
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsTimeField);
//FileUpload
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsFileUpload);
//CountryList
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsCountryList);
//NumericField
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsNumericField);
//PhoneField
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsPhoneField);
//AddressField
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsAddressField);
//GoogleMaps
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsGoogleMaps);
if (await this.page.isVisible(Selectors_PF_Create.add_CustomFields_PF.prompt2PopUpModalOk)) {
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.prompt2PopUpModalOk);
}
//StepStart
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsStepStart);
if (await this.page.isVisible(Selectors_PF_Create.add_CustomFields_PF.prompt1PopUpModalClose)) {
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.prompt1PopUpModalClose);
}
//Embed
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsEmbed); //TODO: This is an Error as position changes in Lite and Pro

await this.page.waitForLoadState('domcontentloaded');

}

await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsGoogleMaps);
if (await this.page.isVisible(Selectors_PF_Create.add_CustomFields_PF.prompt2PopUpModalOk)) {
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.prompt2PopUpModalOk);
}
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsStepStart);
if (await this.page.isVisible(Selectors_PF_Create.add_CustomFields_PF.prompt1PopUpModalClose)) {
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.prompt1PopUpModalClose);
}
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.customFieldsEmbed);

await this.page.waitForLoadState('domcontentloaded');
};

//Validate > CustomFields
@@ -224,33 +244,40 @@ export class PostForms_Create {
//ImageUpload
await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_ImageUpload)).toBeTruthy();

//From PRO
//RepeatField
await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_RepeatField)).toBeTruthy();
//DateTime
await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_DateTime)).toBeTruthy();
//TimeField
await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_TimeField)).toBeTruthy();
//FileUpload
await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_FileUpload)).toBeTruthy();
//CountryList
await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_CountryList)).toBeTruthy();
//NumericField
await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_NumericField)).toBeTruthy();
//PhoneField
await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_PhoneField)).toBeTruthy();
//AddressField
await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_AddressField)).toBeTruthy();

//GoogleMaps //TODO: Setup required
// if(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_GoogleMaps) == true){
// await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_GoogleMaps)).toBeTruthy();
// }

//StepStart
await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_StepStart)).toBeTruthy();
//Embed
await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_Embed)).toBeTruthy();
const Pro_CustomFields_PF = await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_RepeatField);
if (Pro_CustomFields_PF === true) {
//RepeatField
await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_RepeatField)).toBeTruthy();
//DateTime
await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_DateTime)).toBeTruthy();
//TimeField
await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_TimeField)).toBeTruthy();
//FileUpload
await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_FileUpload)).toBeTruthy();
//CountryList
await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_CountryList)).toBeTruthy();
//NumericField
await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_NumericField)).toBeTruthy();
//PhoneField
await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_PhoneField)).toBeTruthy();
//AddressField
await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_AddressField)).toBeTruthy();

//GoogleMaps //TODO: Setup required
// if(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_GoogleMaps) == true){
// await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_GoogleMaps)).toBeTruthy();
// }

//StepStart
await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_StepStart)).toBeTruthy();
//Embed
await expect(await this.page.isVisible(Selectors_PF_Create.validate_CustomFields_PF.val_Embed)).toBeTruthy();

}



};

@@ -262,40 +289,43 @@ export class PostForms_Create {
await this.page.click(Selectors_PF_Create.add_Others_PF.othersColumns);
await this.page.click(Selectors_PF_Create.add_Others_PF.othersSectionBreak);
await this.page.click(Selectors_PF_Create.add_Others_PF.othersCustomHTML);
//From_PRO
//await this.page.click(Selectors_PF_Create.createPostForm.qrCode);
await this.page.click(Selectors_PF_Create.add_Others_PF.othersReCaptcha);
if (await this.page.isVisible(Selectors_PF_Create.add_CustomFields_PF.prompt2PopUpModalOk)) {
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.prompt2PopUpModalOk);
}
await this.page.click(Selectors_PF_Create.add_Others_PF.othersShortCode);
if (await this.page.isVisible(Selectors_PF_Create.add_CustomFields_PF.prompt1PopUpModalClose)) {
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.prompt1PopUpModalClose);
}
await this.page.click(Selectors_PF_Create.add_Others_PF.othersActionHook);
await this.page.click(Selectors_PF_Create.add_Others_PF.othersTermsAndConditions);
await this.page.click(Selectors_PF_Create.add_Others_PF.othersRatings);
await this.page.click(Selectors_PF_Create.add_Others_PF.othersReallySimpleCaptcha);
if (await this.page.isVisible(Selectors_PF_Create.add_CustomFields_PF.prompt2PopUpModalOk)) {
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.prompt2PopUpModalOk);
}
await this.page.click(Selectors_PF_Create.add_Others_PF.othersMathCaptcha);
await this.page.waitForLoadState('domcontentloaded');

};

//Settings > MultiStep Check
async set_MultiStep_Settings_PF() {
await this.page.waitForLoadState('domcontentloaded');
//Add Multi-Step-Check
await this.page.click(Selectors_PF_Create.add_Others_PF.formEditorSettings);
await this.page.click(Selectors_PF_Create.add_Others_PF.checkMultiStepOption);
expect(await this.page.isChecked(Selectors_PF_Create.add_Others_PF.checkMultiStepOption)).toBeTruthy();
//From_PRO
await this.page.click(Selectors_PF_Create.add_Others_PF.othersShortCode);
const Check_Pro_Pop_UP = await this.page.isVisible(Selectors_PF_Create.add_CustomFields_PF.check_Pro_Pop_UP);
if (Check_Pro_Pop_UP === true) {
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.check_Pro_Pop_UP);
console.log("WPUF Pro is requred...")
}

else {
//ShortCode
if (await this.page.isVisible(Selectors_PF_Create.add_CustomFields_PF.prompt1PopUpModalClose)) {
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.prompt1PopUpModalClose);
}
//ActionHook
await this.page.click(Selectors_PF_Create.add_Others_PF.othersActionHook);
//TermsAndConditions
await this.page.click(Selectors_PF_Create.add_Others_PF.othersTermsAndConditions);
//Ratings
await this.page.click(Selectors_PF_Create.add_Others_PF.othersRatings);
//ReallySimpleCaptcha
await this.page.click(Selectors_PF_Create.add_Others_PF.othersReallySimpleCaptcha);
if (await this.page.isVisible(Selectors_PF_Create.add_CustomFields_PF.prompt2PopUpModalOk)) {
await this.page.click(Selectors_PF_Create.add_CustomFields_PF.prompt2PopUpModalOk);
}
//MathCaptcha
await this.page.click(Selectors_PF_Create.add_Others_PF.othersMathCaptcha);
await this.page.waitForLoadState('domcontentloaded');
}

await this.page.waitForLoadState('domcontentloaded');
};


//Validate > Others
async validate_Others_PF() {
//Validate
@@ -306,24 +336,46 @@ export class PostForms_Create {
//CustomHTML
await expect(await this.page.isVisible(Selectors_PF_Create.validate_Others_PF.val_CustomHTML)).toBeTruthy();

//From PRO
//ReCaptcha
//Not visible
//Shortcode
await expect(await this.page.isVisible(Selectors_PF_Create.validate_Others_PF.val_Shortcode)).toBeTruthy();
//ActionHook
await expect(await this.page.isVisible(Selectors_PF_Create.validate_Others_PF.val_ActionHook)).toBeTruthy();
//TermsAndConditions
await expect(await this.page.isVisible(Selectors_PF_Create.validate_Others_PF.val_TermsAndConditions)).toBeTruthy();
//Ratings
await expect(await this.page.isVisible(Selectors_PF_Create.validate_Others_PF.val_Ratings)).toBeTruthy();
//ReallySimpletCaptcha
//Not visible
//MathCaptcha
await expect(await this.page.isVisible(Selectors_PF_Create.validate_Others_PF.val_MathCaptcha)).toBeTruthy();

const Pro_Others_PF = await this.page.isVisible(Selectors_PF_Create.validate_Others_PF.val_Shortcode);
if (Pro_Others_PF === true) {
//Shortcode
await expect(await this.page.isVisible(Selectors_PF_Create.validate_Others_PF.val_Shortcode)).toBeTruthy();
//ActionHook
await expect(await this.page.isVisible(Selectors_PF_Create.validate_Others_PF.val_ActionHook)).toBeTruthy();
//TermsAndConditions
await expect(await this.page.isVisible(Selectors_PF_Create.validate_Others_PF.val_TermsAndConditions)).toBeTruthy();
//Ratings
await expect(await this.page.isVisible(Selectors_PF_Create.validate_Others_PF.val_Ratings)).toBeTruthy();
//ReallySimpletCaptcha
//Not visible
//MathCaptcha
await expect(await this.page.isVisible(Selectors_PF_Create.validate_Others_PF.val_MathCaptcha)).toBeTruthy();
}
};


//Settings > MultiStep Check
async set_MultiStep_Settings_PF() {
await this.page.waitForLoadState('domcontentloaded');
//Add Multi-Step-Check
await this.page.click(Selectors_PF_Create.add_Others_PF.formEditorSettings);
const Pro_Text_Alert_In_Settings = await this.page.isVisible(Selectors_PF_Create.add_CustomFields_PF.pro_Text_Alert_In_Settings);
if (Pro_Text_Alert_In_Settings === true) {
console.log("WPUF Pro is requred...");
}
else {
await this.page.click(Selectors_PF_Create.add_Others_PF.checkMultiStepOption);
expect(await this.page.isChecked(Selectors_PF_Create.add_Others_PF.checkMultiStepOption)).toBeTruthy();
}


await this.page.waitForLoadState('domcontentloaded');
};



/********************* SaveForm *********************/
12 changes: 10 additions & 2 deletions tests/e2e/pages/02_PostForms/selectors_PF_Create.ts
Original file line number Diff line number Diff line change
@@ -118,6 +118,10 @@ export const Selectors_PF_Create = {
prompt1PopUpModalClose: "//button[contains(@class,'swal2-confirm btn')]",
//prompt2
prompt2PopUpModalOk:'//button[contains(@class,"swal2-confirm swal2-styled")]',
//Pro Check Pop Up
check_Pro_Pop_UP: '//button[text()="Get the Pro version"]',
//Pro Text Alert in Settings
pro_Text_Alert_In_Settings: '(//h3[@class="wpuf-pro-text-alert"])[1]'
},

validate_CustomFields_PF: {
@@ -153,10 +157,14 @@ export const Selectors_PF_Create = {
othersColumns: '//li[@data-form-field="column_field"]',
othersSectionBreak: '//li[@data-form-field="section_break"]',
othersCustomHTML: '//li[@data-form-field="custom_html"]',

//From___PRO
othersQrCode: '//li[@data-form-field="qr_code"]',
othersReCaptcha: '//li[@data-form-field="recaptcha"]',


//From___PRO
//Pro Check Pop Up
//check_Pro_Pop_UP: '//button[text()="Get the Pro version"]',
//Pro Field Options
othersShortCode: '//li[@data-form-field="shortcode"]',
othersActionHook: '//li[@data-form-field="action_hook"]',
othersTermsAndConditions: '//li[@data-form-field="toc"]',
Loading