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

Added tests for the Review page #156

Closed
wants to merge 8 commits into from
217 changes: 127 additions & 90 deletions playwright_test/Pages/apfAuth.page.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
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;
userNameInputSelector: Locator;
writeConfig_greenCheckXpath: Locator;
Expand All @@ -13,7 +14,6 @@
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 @@ -23,32 +23,29 @@
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;
this.pageTitle = page.locator("//div[@class='MuiBox-root css-la96ob']/div")
this.continueButtonSelector = page.locator('.MuiButton-containedPrimary.MuiButton-sizeMedium')
this.userNameInputSelector = page.locator('label:has-text("User Name") + div input#standard-required')
this.writeConfig_greenCheckXpath = page.locator('#card-download-progress-card svg.MuiSvgIcon-colorSuccess')
Expand All @@ -70,11 +67,11 @@
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 @@ -83,106 +80,146 @@
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')

//this.select_SMPE = page.getByLabel('//button[contains(text(),"SMP/E")]')
this.select_SMPE = page.locator('span:has-text("SMP/E")');

}
async returnTitleOfApfAuthPage(){
const ApfAuthTitle = await this.APFAUTH_TITLE.textContent();
return ApfAuthTitle;

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 movetoApfAuthPage() {
await this.commonPage.waitForElement(this.click_ApfAuth)
await this.click_ApfAuth.click({ timeout: 9000 })
}

async selectInstallationType(){
await this.select_SMPE.waitFor({ state: 'visible', timeout: 9000 }); // Adjust timeout if needed
console.log('SMP/E span is visible.');
await this.select_SMPE.click({timeout: 9000})
}

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

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 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;
97 changes: 97 additions & 0 deletions playwright_test/Pages/certificates.page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import { Page, Locator } from '@playwright/test';

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

View workflow job for this annotation

GitHub Actions / lint

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

class CertificatesPage {
page: Page;
pageTitle: Locator;
viewEditYaml: Locator;
viewSubmitJob: Locator;
viewJobOutput: Locator;
saveAndClose: Locator;
previousStep: Locator;
skipCertificates: Locator;
continueToLaunchSetup: Locator;
editorTitleElement: Locator;
closeEditorButton: Locator;

constructor(page: Page) {
this.page = page;
this.pageTitle = page.locator("//div[@class='MuiBox-root css-la96ob']/div")
this.viewEditYaml = page.locator("//button[text()='View/Edit Yaml']")
this.viewSubmitJob = page.locator("//button[text()='View/Submit Job']")
this.viewJobOutput = page.locator("//button[text()='View Job Output']")
this.saveAndClose = page.locator("//button[text()='Save & close']")
this.previousStep = page.locator("//button[text()='Previous step']")
this.skipCertificates = page.locator("//button[contains(text(),'Skip')]")
this.continueToLaunchSetup = page.locator("//button[text()='Continue to Launch Setup']")
this.editorTitleElement = page.locator("//h2[text()='Editor']")
this.closeEditorButton = page.locator("//button[text()='Close']")
}

commonPage = new CommonPage();

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

async clickViewEditYaml() {
await this.commonPage.waitForElement(this.viewEditYaml)
await this.viewEditYaml.click();
}

async clickViewSubmitJob() {
await this.commonPage.waitForElement(this.viewSubmitJob)
await this.viewSubmitJob.click();
}

async clickViewJobOutput() {
await this.commonPage.waitForElement(this.viewJobOutput)
await this.viewJobOutput.click();
await this.page.waitForTimeout(2000);
}

async clickSaveAndClose() {
await this.commonPage.waitForElement(this.saveAndClose)
await this.saveAndClose.click({ timeout: 2000 });
}

async clickPreviousStep() {
await this.commonPage.waitForElement(this.previousStep)
await this.previousStep.click();
}

async clickSkipCertificates() {
await this.commonPage.waitForElement(this.skipCertificates)
await this.skipCertificates.click();
}

async clickContinueToLaunchSetup() {
await this.commonPage.waitForElement(this.continueToLaunchSetup)
await this.continueToLaunchSetup.click();
}

async isContinueToLaunchSetupDisabled() {
await this.commonPage.waitForElement(this.continueToLaunchSetup)
return await this.continueToLaunchSetup.isDisabled()
}

async isContinueToLaunchSetupEnabled() {
await this.commonPage.waitForElement(this.continueToLaunchSetup)
return await this.continueToLaunchSetup.isEnabled()
}

async open_monacoEditor() {
await this.commonPage.waitForElement(this.viewEditYaml)
this.viewEditYaml.click({ timeout: 2000 })
await this.commonPage.waitForElement(this.editorTitleElement)
const editor_title = await this.editorTitleElement.textContent();
return editor_title;
}

async clickCloseEditor() {
await this.commonPage.waitForElement(this.closeEditorButton)
await this.closeEditorButton.click();
}
}
export default CertificatesPage;
Loading
Loading