Skip to content

Commit

Permalink
Improved automation suite for waits, syntax, functions
Browse files Browse the repository at this point in the history
Signed-off-by: sagar-1310 <[email protected]>
  • Loading branch information
sagaryadavs committed Jun 4, 2024
1 parent f11b018 commit dc92d12
Show file tree
Hide file tree
Showing 22 changed files with 2,103 additions and 1,762 deletions.
215 changes: 129 additions & 86 deletions playwright_test/Pages/apfAuth.page.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Page,ElectronApplication, Locator,_electron as electron } from '@playwright/test';
let electronApp: ElectronApplication
import { Page, Locator } from '@playwright/test';

Check failure on line 1 in playwright_test/Pages/apfAuth.page.ts

View workflow job for this annotation

GitHub Actions / lint

missing header
import CommonPage from './common.page';

class ApfAuthPage{
class ApfAuthPage {
page: Page;
pageTitle: Locator;
continueButtonSelector: Locator;
Expand All @@ -14,7 +14,6 @@ class ApfAuthPage{
skip_apf_auth_button: Locator;
continue_apfauth_setup: Locator;
continue_security_setup: Locator;
continueButtonSelector: Locator;
editor_title_element: Locator;
installationTitle: Locator;
APFAUTH_TITLE: Locator;
Expand All @@ -24,23 +23,25 @@ class ApfAuthPage{
licenseAgreement: Locator;
acceptLicense: Locator;
datasetPrefix: Locator;
authLoadLib:Locator;
authLoadLib: Locator;
authpluginLib: Locator;
skipInstallation:Locator;
run_zwe_init_apfauth:Locator;
view_yaml:Locator;
view_submit_job:Locator;
view_job_output:Locator;
save_and_close:Locator;
skip_apf_auth:Locator;
previous_step:Locator;
securityTab_title:Locator;
initApfauth:Locator;
close_button:Locator;
securityTab_title:Locator;
auth_load_lib_value:Locator;
auth_plugin_lib_value:Locator;
dataset_prefix_value:Locator;
skipInstallation: Locator;
run_zwe_init_apfauth: Locator;
view_yaml: Locator;
view_submit_job: Locator;
view_job_output: Locator;
save_and_close: Locator;
skip_apf_auth: Locator;
previous_step: Locator;
securityTab_title: Locator;
initApfauth: Locator;
close_button: Locator;
auth_load_lib_value: Locator;
auth_plugin_lib_value: Locator;
dataset_prefix_value: Locator;
click_ApfAuth: Locator;
viewAndSubmitJob: Locator;
continueToComponentInstallation: Locator;

constructor(page: Page) {
this.page = page;
Expand All @@ -66,11 +67,11 @@ class ApfAuthPage{
this.authpluginLib = page.getByLabel('Auth Plugin Lib')
this.click_ApfAuth = page.locator('//span[text()="Apf Auth"]');
this.skipInstallation = page.locator('//button[contains(text(),"Skip")]')
this.run_zwe_init_apfauth = page.locator('//button[contains(text(),"zwe init apfauth")]')
this.view_yaml = page.locator('//button[contains(text(),"View/Edit Yaml")]')
this.viewAndSubmitJob = page.locator('//button[contains(text(), "View Job Output")]')
this.view_job_output = page.locator('//button[contains(text(), "Submit Job")]')
this.save_and_close = page.locator('//button[contains(text(),"Save & close")]')
this.run_zwe_init_apfauth = page.locator('//button[contains(text(),"zwe init apfauth")]')
this.view_yaml = page.locator('//button[contains(text(),"View/Edit Yaml")]')
this.viewAndSubmitJob = page.locator('//button[contains(text(), "View Job Output")]')
this.view_job_output = page.locator('//button[contains(text(), "Submit Job")]')
this.save_and_close = page.locator('//button[contains(text(),"Save & close")]')
this.previous_step = page.locator('//button[contains(text(),"Previous step")]')
this.skip_apf_auth = page.locator('//button[contains(text(),"Skip")]')
this.initApfauth = page.locator('//button[contains(text(),"zwe init apfauth")]')
Expand All @@ -79,97 +80,139 @@ class ApfAuthPage{
this.dataset_prefix_value = page.getByLabel('Dataset Prefix')
this.auth_load_lib_value = page.getByLabel('APF Authorized Load Library')
this.auth_plugin_lib_value = page.getByLabel('Zowe ZIS Plugins Load Library')

}

async getApfAuthPageTitle(){
await this.page.waitForTimeout(1000)
commonPage = new CommonPage();

async getApfAuthPageTitle() {
await this.commonPage.waitForElement(this.pageTitle)
return await this.pageTitle.textContent({ timeout: 2000 });
}

async movetoApfAuthPage(){
await this.click_ApfAuth.click({timeout: 9000})
}
async movetoInstallationPage(){
await this.licenseAgreement.click({timeout: 9000})
await this.acceptLicense.click({timeout: 9000})
await this.continueToComponentInstallation.click({timeout: 5000})

async movetoApfAuthPage() {
await this.commonPage.waitForElement(this.click_ApfAuth)
await this.click_ApfAuth.click({ timeout: 9000 })
}

async fillApfDetails(datasetPrefix:string, authLoadLib:string,authpluginLib:string){
await this.datasetPrefix.fill(datasetPrefix,{ timeout: 10000 })
await this.authLoadLib.fill(authLoadLib,{ timeout: 10000 })
await this.authpluginLib.fill(authpluginLib,{ timeout: 10000 })
async movetoInstallationPage() {
await this.commonPage.waitForElement(this.licenseAgreement)
await this.licenseAgreement.click({ timeout: 9000 })
await this.commonPage.waitForElement(this.acceptLicense)
await this.acceptLicense.click({ timeout: 9000 })
await this.commonPage.waitForElement(this.continueToComponentInstallation)
await this.continueToComponentInstallation.click({ timeout: 5000 })
}
async initializeApfauth(){
await this.initApfauth.click()

async fillApfDetails(datasetPrefix: string, authLoadLib: string, authpluginLib: string) {
await this.commonPage.waitForElement(this.datasetPrefix)
await this.datasetPrefix.clear({ timeout: 2000 })
await this.datasetPrefix.fill(datasetPrefix, { timeout: 10000 })
await this.commonPage.waitForElement(this.authLoadLib)
await this.authLoadLib.clear({ timeout: 2000 })
await this.authLoadLib.fill(authLoadLib, { timeout: 10000 })
await this.commonPage.waitForElement(this.authpluginLib)
await this.authpluginLib.clear({ timeout: 2000 })
await this.authpluginLib.fill(authpluginLib, { timeout: 10000 })
}
async isWriteConfigGreenCheckVisible(){
return await this.writeConfig_greenCheckXpath.isVisible({ timeout: 50000 });

async initializeApfauth() {
await this.commonPage.waitForElement(this.initApfauth)
await this.initApfauth.click()
}
async isUploadConfigGreenCheckVisible(){
return await this.uploadYaml_greenCheckXpath.isVisible({ timeout: 50000 });

async isWriteConfigGreenCheckVisible() {
await this.commonPage.waitForElement(this.writeConfig_greenCheckXpath)
return await this.writeConfig_greenCheckXpath.isVisible({ timeout: 50000 });
}
async isInitApfGreenCheckVisible(){
return await this.init_apfauth_greenCheckXpath.isVisible({ timeout: 50000 });

async isUploadConfigGreenCheckVisible() {
await this.commonPage.waitForElement(this.uploadYaml_greenCheckXpath)
return await this.uploadYaml_greenCheckXpath.isVisible({ timeout: 50000 });
}
async isPreviousButtonEnable(){
return await this.previous_step.isEnabled({ timeout: 50000 });

async isInitApfGreenCheckVisible() {
await this.commonPage.waitForElement(this.init_apfauth_greenCheckXpath)
return await this.init_apfauth_greenCheckXpath.isVisible({ timeout: 50000 });
}

async returnTitleOfPrevPage(){
await this.previous_step_button.click({ timeout: 2000 });
const installation_title = await this.installationTitle.textContent();
return installation_title;
async isPreviousButtonEnable() {
await this.commonPage.waitForElement(this.previous_step)
return await this.previous_step.isEnabled({ timeout: 50000 });
}
async viewYaml(){
await this.view_yaml.click({ timeout: 2000 })

async returnTitleOfPrevPage() {
await this.commonPage.waitForElement(this.previous_step_button)
await this.previous_step_button.click({ timeout: 2000 });
const installation_title = await this.installationTitle.textContent();
return installation_title;
}
async closeButton(){
await this.close_button.click({ timeout: 5000 })

async viewYaml() {
await this.commonPage.waitForElement(this.view_yaml)
await this.view_yaml.click({ timeout: 2000 })
}
async click_viewAndSubmitJob(){
await this.viewAndSubmitJob.click({ timeout: 6000 })

async closeButton() {
await this.commonPage.waitForElement(this.close_button)
await this.close_button.click({ timeout: 5000 })
}
async click_previewJob(){
await this.view_job_output.click({ timeout: 6000 })

async click_viewAndSubmitJob() {
await this.commonPage.waitForElement(this.viewAndSubmitJob)
await this.viewAndSubmitJob.click({ timeout: 6000 })
}
async is_skipApfAuthButtonEnable(){
return await this.skip_apf_auth_button.isEnabled({ timeout: 5000 });

async click_previewJob() {
await this.commonPage.waitForElement(this.view_job_output)
await this.view_job_output.click({ timeout: 6000 })
}

async click_skipApfAuth(){
await this.skip_apf_auth_button.click({ timeout: 2000 });
const securityPage_title = await this.securityTab_title.textContent();
return securityPage_title;
async is_skipApfAuthButtonEnable() {
await this.commonPage.waitForElement(this.skip_apf_auth_button)
return await this.skip_apf_auth_button.isEnabled({ timeout: 5000 });
}

async open_monacoEditor(){
this.view_yaml.click({ timeout: 2000 })
const editor_title = await this.editor_title_element.textContent();
return editor_title;
async click_skipApfAuth() {
await this.commonPage.waitForElement(this.skip_apf_auth_button)
await this.skip_apf_auth_button.click({ timeout: 2000 });
const securityPage_title = await this.securityTab_title.textContent();
return securityPage_title;
}

async isContinueButtonDisable(){
return await this.continue_security_setup.isDisabled({ timeout: 5000 });
async open_monacoEditor() {
await this.commonPage.waitForElement(this.view_yaml)
this.view_yaml.click({ timeout: 2000 })
const editor_title = await this.editor_title_element.textContent();
return editor_title;
}
async click_saveAndClose(){
this.save_and_close.click({ timeout: 2000 })

async isContinueButtonDisable() {
await this.commonPage.waitForElement(this.continue_security_setup)
return await this.continue_security_setup.isDisabled({ timeout: 5000 });
}
async get_datasetPrefix_value(){
const dataset_prefix = await this.dataset_prefix_value.textContent();
return dataset_prefix;

async click_saveAndClose() {
await this.commonPage.waitForElement(this.save_and_close)
this.save_and_close.click({ timeout: 2000 })
}
async get_authPluginLib_value(){
const authPluginLib_value = await this.auth_plugin_lib_value.textContent();
return authPluginLib_value;

async get_datasetPrefix_value() {
await this.commonPage.waitForElement(this.dataset_prefix_value)
const dataset_prefix = await this.dataset_prefix_value.textContent();
return dataset_prefix;
}

async get_authLoadLib_value(){
const authPluginLib_value = await this.auth_load_lib_value.textContent();
return authPluginLib_value;
async get_authPluginLib_value() {
await this.commonPage.waitForElement(this.auth_plugin_lib_value)
const authPluginLib_value = await this.auth_plugin_lib_value.textContent();
return authPluginLib_value;
}

async get_authLoadLib_value() {
await this.commonPage.waitForElement(this.auth_load_lib_value)
const authPluginLib_value = await this.auth_load_lib_value.textContent();
return authPluginLib_value;
}

}
export default ApfAuthPage;
export default ApfAuthPage;
Loading

0 comments on commit dc92d12

Please sign in to comment.