Skip to content

Commit

Permalink
Added Review Page Tests
Browse files Browse the repository at this point in the history
Signed-off-by: sagar-1310 <[email protected]>
  • Loading branch information
sagaryadavs committed Oct 24, 2024
1 parent 1c2008f commit 99f5734
Show file tree
Hide file tree
Showing 16 changed files with 1,443 additions and 878 deletions.
195 changes: 92 additions & 103 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 @@ 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 @@ -23,32 +23,29 @@ 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;
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 @@ 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 @@ -83,106 +80,98 @@ 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')

//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;
}

async movetoApfAuthPage(){
await this.click_ApfAuth.click({timeout: 9000})
commonPage = new CommonPage();

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

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 movetoApfAuthPage() {
await this.commonPage.waitForElement(this.click_ApfAuth)
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 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 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 initializeApfauth() {
await this.initApfauth.click()
}
async isWriteConfigGreenCheckVisible(){
return await this.writeConfig_greenCheckXpath.isVisible({ timeout: 50000 });
async isWriteConfigGreenCheckVisible() {
return await this.writeConfig_greenCheckXpath.isVisible({ timeout: 50000 });
}
async isUploadConfigGreenCheckVisible(){
return await this.uploadYaml_greenCheckXpath.isVisible({ timeout: 50000 });
async isUploadConfigGreenCheckVisible() {
return await this.uploadYaml_greenCheckXpath.isVisible({ timeout: 50000 });
}
async isInitApfGreenCheckVisible(){
return await this.init_apfauth_greenCheckXpath.isVisible({ timeout: 50000 });
async isInitApfGreenCheckVisible() {
return await this.init_apfauth_greenCheckXpath.isVisible({ timeout: 50000 });
}
async isPreviousButtonEnable(){
return await this.previous_step.isEnabled({ timeout: 50000 });
async isPreviousButtonEnable() {
return await this.previous_step.isEnabled({ timeout: 50000 });
}

async returnTitleOfPrevPage(){
await this.previous_step_button.click({ timeout: 2000 });
const installation_title = await this.installationTitle.textContent();
return installation_title;
async returnTitleOfPrevPage() {
await this.previous_step_button.click({ timeout: 2000 });
const installation_title = await this.installationTitle.textContent();
return installation_title;
}
async viewYaml(){
await this.view_yaml.click({ timeout: 2000 })
async viewYaml() {
await this.view_yaml.click({ timeout: 2000 })
}
async closeButton(){
await this.close_button.click({ timeout: 5000 })
async closeButton() {
await this.close_button.click({ timeout: 5000 })
}
async click_viewAndSubmitJob(){
await this.viewAndSubmitJob.click({ timeout: 6000 })
async click_viewAndSubmitJob() {
await this.viewAndSubmitJob.click({ timeout: 6000 })
}
async click_previewJob(){
await this.view_job_output.click({ timeout: 6000 })
async click_previewJob() {
await this.view_job_output.click({ timeout: 6000 })
}
async is_skipApfAuthButtonEnable(){
return await this.skip_apf_auth_button.isEnabled({ timeout: 5000 });
async is_skipApfAuthButtonEnable() {
return await this.skip_apf_auth_button.isEnabled({ timeout: 5000 });
}

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

async open_monacoEditor(){
this.view_yaml.click({ timeout: 2000 })
const editor_title = await this.editor_title_element.textContent();
return editor_title;
async open_monacoEditor() {
this.view_yaml.click({ timeout: 2000 })
const editor_title = await this.editor_title_element.textContent();
return editor_title;
}

async isContinueButtonDisable(){
return await this.continue_security_setup.isDisabled({ timeout: 5000 });
async isContinueButtonDisable() {
return await this.continue_security_setup.isDisabled({ timeout: 5000 });
}
async click_saveAndClose(){
this.save_and_close.click({ timeout: 2000 })
async click_saveAndClose() {
this.save_and_close.click({ timeout: 2000 })
}
async get_datasetPrefix_value(){
const dataset_prefix = await this.dataset_prefix_value.textContent();
return dataset_prefix;
async get_datasetPrefix_value() {
const dataset_prefix = await this.dataset_prefix_value.textContent();
return dataset_prefix;
}
async get_authPluginLib_value(){
const authPluginLib_value = await this.auth_plugin_lib_value.textContent();
return authPluginLib_value;
async get_authPluginLib_value() {
const authPluginLib_value = await this.auth_plugin_lib_value.textContent();
return authPluginLib_value;
}

async get_authLoadLib_value(){
const authPluginLib_value = await this.auth_load_lib_value.textContent();
return authPluginLib_value;
async get_authLoadLib_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

0 comments on commit 99f5734

Please sign in to comment.