From dc92d12009bd9c18494dc804f6377d5cc77e88d6 Mon Sep 17 00:00:00 2001 From: sagar-1310 Date: Tue, 4 Jun 2024 18:03:25 +0530 Subject: [PATCH] Improved automation suite for waits, syntax, functions Signed-off-by: sagar-1310 --- playwright_test/Pages/apfAuth.page.ts | 215 +++++---- playwright_test/Pages/certificates.page.ts | 70 +-- playwright_test/Pages/common.page.ts | 35 ++ playwright_test/Pages/connection.page.ts | 80 +++- playwright_test/Pages/installation.page.ts | 157 ++++--- .../Pages/installationType.page.ts | 112 ++--- playwright_test/Pages/launchConfig.page.ts | 273 +++++++----- playwright_test/Pages/networking.page.ts | 374 ++++++++++------ playwright_test/Pages/planning.page.ts | 231 ++++++---- playwright_test/Pages/review.page.ts | 119 ++--- playwright_test/Pages/security.page.ts | 318 ++++++++------ playwright_test/Pages/title.page.ts | 20 +- playwright_test/Tests/ApfAuth.spec.ts | 404 +++++++++-------- playwright_test/Tests/Connection.spec.ts | 28 +- playwright_test/Tests/Installation.spec.ts | 60 ++- .../Tests/InstallationType.spec.ts | 48 +- playwright_test/Tests/LaunchConfig.spec.ts | 211 +++++---- playwright_test/Tests/Networking.spec.ts | 227 +++++----- playwright_test/Tests/Planning.spec.ts | 409 +++++++++--------- playwright_test/Tests/Review.spec.ts | 60 ++- playwright_test/Tests/Security.spec.ts | 374 ++++++++-------- playwright_test/Tests/titleTab.spec.ts | 40 +- 22 files changed, 2103 insertions(+), 1762 deletions(-) create mode 100644 playwright_test/Pages/common.page.ts diff --git a/playwright_test/Pages/apfAuth.page.ts b/playwright_test/Pages/apfAuth.page.ts index 7f0ea0cd..aad9acfc 100644 --- a/playwright_test/Pages/apfAuth.page.ts +++ b/playwright_test/Pages/apfAuth.page.ts @@ -1,7 +1,7 @@ -import { Page,ElectronApplication, Locator,_electron as electron } from '@playwright/test'; -let electronApp: ElectronApplication +import { Page, Locator } from '@playwright/test'; +import CommonPage from './common.page'; -class ApfAuthPage{ +class ApfAuthPage { page: Page; pageTitle: Locator; continueButtonSelector: Locator; @@ -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; @@ -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; @@ -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")]') @@ -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; \ No newline at end of file +export default ApfAuthPage; \ No newline at end of file diff --git a/playwright_test/Pages/certificates.page.ts b/playwright_test/Pages/certificates.page.ts index f2807b2d..858b9a7e 100644 --- a/playwright_test/Pages/certificates.page.ts +++ b/playwright_test/Pages/certificates.page.ts @@ -1,6 +1,7 @@ -import { Page,Locator } from '@playwright/test'; +import { Page, Locator } from '@playwright/test'; +import CommonPage from './common.page'; -class CertificatesPage{ +class CertificatesPage { page: Page; pageTitle: Locator; viewEditYaml: Locator; @@ -16,78 +17,81 @@ class CertificatesPage{ 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.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.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']") } - async getCertificatesPageTitle(){ - await this.page.waitForTimeout(1000) + commonPage = new CommonPage(); + + async getCertificatesPageTitle() { + await this.commonPage.waitForElement(this.pageTitle) return await this.pageTitle.textContent({ timeout: 2000 }); } - async clickViewEditYaml(){ - await this.page.waitForTimeout(500) + async clickViewEditYaml() { + await this.commonPage.waitForElement(this.viewEditYaml) await this.viewEditYaml.click(); } - async clickViewSubmitJob(){ - await this.page.waitForTimeout(500) + async clickViewSubmitJob() { + await this.commonPage.waitForElement(this.viewSubmitJob) await this.viewSubmitJob.click(); } - async clickViewJobOutput(){ - await this.page.waitForTimeout(500) + async clickViewJobOutput() { + await this.commonPage.waitForElement(this.viewJobOutput) await this.viewJobOutput.click(); await this.page.waitForTimeout(2000); } - async clickSaveAndClose(){ - await this.page.waitForTimeout(500) - await this.saveAndClose.click({timeout: 2000}); + async clickSaveAndClose() { + await this.commonPage.waitForElement(this.saveAndClose) + await this.saveAndClose.click({ timeout: 2000 }); } - async clickPreviousStep(){ - await this.page.waitForTimeout(500) + async clickPreviousStep() { + await this.commonPage.waitForElement(this.previousStep) await this.previousStep.click(); } - async clickSkipCertificates(){ - await this.page.waitForTimeout(500) + async clickSkipCertificates() { + await this.commonPage.waitForElement(this.skipCertificates) await this.skipCertificates.click(); } - async clickContinueToLaunchSetup(){ - await this.page.waitForTimeout(500) + async clickContinueToLaunchSetup() { + await this.commonPage.waitForElement(this.continueToLaunchSetup) await this.continueToLaunchSetup.click(); } - async isContinueToLaunchSetupDisabled(){ - await this.page.waitForTimeout(500) + async isContinueToLaunchSetupDisabled() { + await this.commonPage.waitForElement(this.continueToLaunchSetup) return await this.continueToLaunchSetup.isDisabled() } - async isContinueToLaunchSetupEnabled(){ - await this.page.waitForTimeout(500) + async isContinueToLaunchSetupEnabled() { + await this.commonPage.waitForElement(this.continueToLaunchSetup) return await this.continueToLaunchSetup.isEnabled() } - async open_monacoEditor(){ - await this.page.waitForTimeout(1000) + 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.page.waitForTimeout(500) + async clickCloseEditor() { + await this.commonPage.waitForElement(this.closeEditorButton) await this.closeEditorButton.click(); } } - export default CertificatesPage; +export default CertificatesPage; diff --git a/playwright_test/Pages/common.page.ts b/playwright_test/Pages/common.page.ts new file mode 100644 index 00000000..7b134b3f --- /dev/null +++ b/playwright_test/Pages/common.page.ts @@ -0,0 +1,35 @@ +import { Page, Locator } from '@playwright/test'; + +class CommonPage { + page: Page; + + async getElementValue(element: Locator) { + const elementValue = await element.getAttribute('value') + return elementValue + } + + async isElementHasValue(element: Locator) { + const elementValue = await element.getAttribute('value') + if (elementValue !== null && elementValue !== '') { + return true + } else { + return false + } + } + + async validateElementValue(textBoxLocator: Locator, expectedValue: string): Promise { + const insertedValue = await textBoxLocator.inputValue(); + return insertedValue === expectedValue; + } + + async waitForElement(locator: Locator) { + try { + await locator.waitFor({ timeout: 5000 }); + await this.page.waitForTimeout(500); + } catch (error) { + } + } + +} + +export default CommonPage; \ No newline at end of file diff --git a/playwright_test/Pages/connection.page.ts b/playwright_test/Pages/connection.page.ts index 2dc94da2..8a8d8dc1 100644 --- a/playwright_test/Pages/connection.page.ts +++ b/playwright_test/Pages/connection.page.ts @@ -1,6 +1,7 @@ -import { Page,Locator } from '@playwright/test'; +import { Page, Locator } from '@playwright/test'; +import CommonPage from '../Pages/common.page.ts'; -class ConnectionPage{ +class ConnectionPage { page: Page; host: Locator; port: Locator; @@ -27,58 +28,91 @@ class ConnectionPage{ this.greenCheckIconSelector = page.locator('.MuiContainer-root svg[data-testid="CheckCircleIcon"]') } - async fillConnectionDetails(host: string, port: string, username: string, password: string){ - await this.page.waitForTimeout(1000); + commonPage = new CommonPage(); + + async fillConnectionDetails(host: string, port: string, username: string, password: string) { + await this.commonPage.waitForElement(this.host) + await this.host.clear({ timeout: 2000 }) await this.host.fill(host) - await this.page.waitForTimeout(1000); + await this.commonPage.validateElementValue(this.host, host) + await this.commonPage.waitForElement(this.port) + await this.port.clear({ timeout: 2000 }) await this.port.fill(port) - await this.page.waitForTimeout(1000); + await this.commonPage.validateElementValue(this.port, port) + await this.commonPage.waitForElement(this.userName) + await this.userName.clear({ timeout: 2000 }) await this.userName.fill(username) - await this.page.waitForTimeout(1000); + await this.commonPage.validateElementValue(this.userName, username) + await this.commonPage.waitForElement(this.password) + await this.password.clear({ timeout: 2000 }) await this.password.fill(password) + await this.commonPage.validateElementValue(this.password, password) + return true + } + + async performLogin(host: string, port: string, username: string, password: string) { + const connectionDetailsFilled = await this.fillConnectionDetails(host, port, username, password); + if (connectionDetailsFilled) { + this.SubmitValidateCredential(); + } else { + this.fillConnectionDetails(host, port, username, password); + this.SubmitValidateCredential(); + } } - async getHostValue(){ - const value = await this.host.inputValue(); - return value; + async getHostValue() { + await this.commonPage.waitForElement(this.host) + const value = await this.host.inputValue(); + return value; } - async getPortValue(){ - const value = await this.port.inputValue(); - return value; + async getPortValue() { + await this.commonPage.waitForElement(this.port) + const value = await this.port.inputValue(); + return value; } - async getUsernameValue(){ - const value = await this.userName.inputValue(); - return value; + async getUsernameValue() { + await this.commonPage.waitForElement(this.userName) + const value = await this.userName.inputValue(); + return value; } async getConnectionPageTitle() { - await this.page.waitForTimeout(1000); + await this.commonPage.waitForElement(this.connectionPageTitle) return await this.connectionPageTitle.textContent(); } - async SubmitValidateCredential(){ - await this.page.waitForTimeout(1000); + async SubmitValidateCredential() { + await this.commonPage.waitForElement(this.validateCredential) await this.validateCredential.click() } async clickContinueButton() { - await this.page.waitForTimeout(1000); + await this.commonPage.waitForElement(this.continueButton) return await this.continueButton.click(); } - async click_saveAndClose(){ - this.save_and_close.click({ timeout: 5000 }) + async click_saveAndClose() { + await this.commonPage.waitForElement(this.save_and_close) + this.save_and_close.click({ timeout: 5000 }) } async isContinueButtonVisible() { + await this.commonPage.waitForElement(this.continueButton) return await this.continueButton.isDisabled(); } async isGreenCheckIconVisible() { + await this.commonPage.waitForElement(this.greenCheckIconSelector) return await this.greenCheckIconSelector.isHidden(); } + + async click_resumeProgress() { + await this.commonPage.waitForElement(this.resumeProgress) + this.resumeProgress.click({ timeout: 5000 }) + } + } - export default ConnectionPage; \ No newline at end of file +export default ConnectionPage; \ No newline at end of file diff --git a/playwright_test/Pages/installation.page.ts b/playwright_test/Pages/installation.page.ts index e4752476..5739f07d 100644 --- a/playwright_test/Pages/installation.page.ts +++ b/playwright_test/Pages/installation.page.ts @@ -1,6 +1,7 @@ -import { Page,Locator } from '@playwright/test'; +import { Page, Locator } from '@playwright/test'; +import CommonPage from './common.page'; -class InstallationPage{ +class InstallationPage { page: Page; pageTitle: Locator; prefix: Locator; @@ -29,153 +30,173 @@ class InstallationPage{ this.procLib = page.locator("//label[text()='Proclib']//following-sibling::div/input") this.parmLib = page.locator("//label[text()='Parmlib']//following-sibling::div/input") this.zis = page.locator("//label[text()='Zis']//following-sibling::div/input") - this.jclLib = page.locator("//label[text()='Jcllib']//following-sibling::div/input") - this.loadLib = page.locator("//label[text()='Loadlib']//following-sibling::div/input") - this.authLoadLib = page.locator("//label[text()='Auth Loadlib']//following-sibling::div/input") - this.authPluginLib = page.locator("//label[text()='Auth Plugin Lib']//following-sibling::div/input") - this.installMVSDatasets = page.locator("//button[text()='Install MVS datasets']") - 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.jclLib = page.locator("//label[text()='Jcllib']//following-sibling::div/input") + this.loadLib = page.locator("//label[text()='Loadlib']//following-sibling::div/input") + this.authLoadLib = page.locator("//label[text()='Auth Loadlib']//following-sibling::div/input") + this.authPluginLib = page.locator("//label[text()='Auth Plugin Lib']//following-sibling::div/input") + this.installMVSDatasets = page.locator("//button[text()='Install MVS datasets']") + 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.skipInstallation = page.locator("//button[contains(text(),'Skip')]") + this.skipInstallation = page.locator("//button[contains(text(),'Skip')]") this.continueToNetworkSetup = page.locator("//button[text()='Continue to Network Setup']") this.editorTitleElement = page.locator("//h2[text()='Editor']") this.closeEditorButton = page.locator("//button[text()='Close']") } - async getInstallationPageTitle(){ - await this.page.waitForTimeout(1000) + commonPage = new CommonPage(); + + async getInstallationPageTitle() { + await this.commonPage.waitForElement(this.pageTitle) return await this.pageTitle.textContent({ timeout: 2000 }); } - async enterPrefix(prefix: any){ - await this.page.waitForTimeout(500) + async enterPrefix(prefix: any) { + await this.commonPage.waitForElement(this.prefix) + await this.prefix.clear({ timeout: 2000 }) await this.prefix.fill(prefix); + await this.commonPage.validateElementValue(this.prefix, prefix) } - async getPrefixValue(){ - await this.page.waitForTimeout(500) + async getPrefixValue() { + await this.commonPage.waitForElement(this.prefix) return await this.prefix.textContent(); } - - async enterProcLib(proclib: any){ - await this.page.waitForTimeout(500) + + async enterProcLib(proclib: any) { + await this.commonPage.waitForElement(this.procLib) + await this.procLib.clear({ timeout: 2000 }) await this.procLib.fill(proclib); + await this.commonPage.validateElementValue(this.procLib, proclib) } - async getProclibValue(){ - await this.page.waitForTimeout(500) + async getProclibValue() { + await this.commonPage.waitForElement(this.procLib) return await this.procLib.textContent(); } - - async enterParmLib(parmlib: any){ - await this.page.waitForTimeout(500) + + async enterParmLib(parmlib: any) { + await this.commonPage.waitForElement(this.parmLib) + await this.parmLib.clear({ timeout: 2000 }) await this.parmLib.fill(parmlib); + await this.commonPage.validateElementValue(this.parmLib, parmlib) } - async getParmlibValue(){ - await this.page.waitForTimeout(500) + async getParmlibValue() { + await this.commonPage.waitForElement(this.parmLib) return await this.parmLib.textContent(); } - async enterZis(zis: any){ - await this.page.waitForTimeout(500) + async enterZis(zis: any) { + await this.commonPage.waitForElement(this.zis) + await this.zis.clear({ timeout: 2000 }) await this.zis.fill(zis); + await this.commonPage.validateElementValue(this.zis, zis) } - async enterJclLib(Jcllib: any){ - await this.page.waitForTimeout(500) + async enterJclLib(Jcllib: any) { + await this.commonPage.waitForElement(this.jclLib) + await this.jclLib.clear({ timeout: 2000 }) await this.jclLib.fill(Jcllib); + await this.commonPage.validateElementValue(this.jclLib, Jcllib) } - async enterLoadLib(loadlib: any){ - await this.page.waitForTimeout(500) + async enterLoadLib(loadlib: any) { + await this.commonPage.waitForElement(this.loadLib) + await this.loadLib.clear({ timeout: 2000 }) await this.loadLib.fill(loadlib); + await this.commonPage.validateElementValue(this.loadLib, loadlib) } - async enterAuthLoadLib(authloadlib: any){ - await this.page.waitForTimeout(500) + async enterAuthLoadLib(authloadlib: any) { + await this.commonPage.waitForElement(this.authLoadLib) + await this.authLoadLib.clear({ timeout: 2000 }) await this.authLoadLib.fill(authloadlib); + await this.commonPage.validateElementValue(this.authLoadLib, authloadlib) } - async getAuthLoadLibValue(){ - await this.page.waitForTimeout(500) + async getAuthLoadLibValue() { + await this.commonPage.waitForElement(this.authLoadLib) return await this.authLoadLib.textContent(); } - async enterAuthPluginLib(authpluginlib: any){ - await this.page.waitForTimeout(500) + async enterAuthPluginLib(authpluginlib: any) { + await this.commonPage.waitForElement(this.authPluginLib) + await this.authPluginLib.clear({ timeout: 2000 }) await this.authPluginLib.fill(authpluginlib); + await this.commonPage.validateElementValue(this.authPluginLib, authpluginlib) } - async getAuthPluginLibValue(){ - await this.page.waitForTimeout(500) + async getAuthPluginLibValue() { + await this.commonPage.waitForElement(this.authPluginLib) return await this.authPluginLib.textContent(); } - async clickInstallMvsDatasets(){ - await this.page.waitForTimeout(1000) + async clickInstallMvsDatasets() { + await this.commonPage.waitForElement(this.installMVSDatasets) await this.installMVSDatasets.click(); } - async clickViewEditYaml(){ - await this.page.waitForTimeout(500) + async clickViewEditYaml() { + await this.commonPage.waitForElement(this.viewEditYaml) await this.viewEditYaml.click(); } - async clickViewSubmitJob(){ - await this.page.waitForTimeout(500) + async clickViewSubmitJob() { + await this.commonPage.waitForElement(this.viewSubmitJob) await this.viewSubmitJob.click(); } - async clickViewJobOutput(){ - await this.page.waitForTimeout(500) + async clickViewJobOutput() { + await this.commonPage.waitForElement(this.viewJobOutput) await this.viewJobOutput.click(); await this.page.waitForTimeout(2000); } - async clickSaveAndClose(){ - await this.page.waitForTimeout(500) - await this.saveAndClose.click({timeout: 2000}); + async clickSaveAndClose() { + await this.commonPage.waitForElement(this.saveAndClose) + await this.saveAndClose.click({ timeout: 2000 }); } - async clickPreviousStep(){ - await this.page.waitForTimeout(500) + async clickPreviousStep() { + await this.commonPage.waitForElement(this.previousStep) await this.previousStep.click(); } - async clickSkipInstallation(){ - await this.page.waitForTimeout(500) + async clickSkipInstallation() { + await this.commonPage.waitForElement(this.skipInstallation) await this.skipInstallation.click(); } - async clickContinueToNetworkSetup(){ - await this.page.waitForTimeout(500) + async clickContinueToNetworkSetup() { + await this.commonPage.waitForElement(this.continueToNetworkSetup) await this.continueToNetworkSetup.click(); } - async isContinueToNetworkSetupDisabled(){ - await this.page.waitForTimeout(500) + async isContinueToNetworkSetupDisabled() { + await this.commonPage.waitForElement(this.continueToNetworkSetup) return await this.continueToNetworkSetup.isDisabled() } - async isContinueToNetworkSetupEnabled(){ - await this.page.waitForTimeout(500) + async isContinueToNetworkSetupEnabled() { + await this.commonPage.waitForElement(this.continueToNetworkSetup) return await this.continueToNetworkSetup.isEnabled() } - async open_monacoEditor(){ - await this.page.waitForTimeout(1000) + 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.page.waitForTimeout(500) + async clickCloseEditor() { + await this.commonPage.waitForElement(this.closeEditorButton) await this.closeEditorButton.click(); } + } - export default InstallationPage; +export default InstallationPage; diff --git a/playwright_test/Pages/installationType.page.ts b/playwright_test/Pages/installationType.page.ts index b451ce2c..7d4ce1fb 100644 --- a/playwright_test/Pages/installationType.page.ts +++ b/playwright_test/Pages/installationType.page.ts @@ -1,6 +1,7 @@ -import { Page,Locator } from '@playwright/test'; +import { Page, Locator } from '@playwright/test'; +import CommonPage from './common.page'; -class InstallationTypePage{ +class InstallationTypePage { page: Page; pageTitle: Locator; downloadPax: Locator; @@ -26,7 +27,7 @@ class InstallationTypePage{ this.uploadPax = page.locator("//span[text()='Upload Zowe PAX for offline install']/preceding-sibling::span/input") this.smpe = page.locator("//span[text()='SMP/E']/preceding-sibling::span/input") this.licenseAgreement = page.locator("//button[text()='License Agreement']") - this.saveAndClose = page.locator("//button[contains(text(),'Save & close')]") + this.saveAndClose = page.locator("//button[contains(text(),'Save & close')]") this.previousStep = page.locator("//button[contains(text(),'Previous step')]") this.continueToComponentInstallation = page.locator("//button[text()='Continue to Components Installation']") this.zoweLink = page.locator("//a[@href='zowe.org']") @@ -38,113 +39,116 @@ class InstallationTypePage{ this.licenseAgreementGreenCheck = page.locator("//button[text()='License Agreement']//following-sibling::*[@data-testid='CheckCircleIcon']") } - async getInstallationTypePageTitle(){ - await this.page.waitForTimeout(1000) + commonPage = new CommonPage(); + + async getInstallationTypePageTitle() { + await this.commonPage.waitForElement(this.pageTitle) return await this.pageTitle.textContent({ timeout: 2000 }); } - async selectDownloadZowePax(){ - await this.page.waitForTimeout(1000) - await this.downloadPax.click({timeout: 5000}) + async selectDownloadZowePax() { + await this.commonPage.waitForElement(this.downloadPax) + await this.downloadPax.click({ timeout: 5000 }) } - async selectUploadZowePax(){ - await this.page.waitForTimeout(2000) - await this.uploadPax.click({timeout: 5000}); + async selectUploadZowePax() { + await this.commonPage.waitForElement(this.uploadPax) + await this.uploadPax.click({ timeout: 5000 }); } - async selectSmpe(){ - await this.page.waitForTimeout(1000) - await this.smpe.click({timeout: 5000}); + async selectSmpe() { + await this.commonPage.waitForElement(this.smpe) + await this.smpe.click({ timeout: 5000 }); } - async clickZoweLink(){ - await this.page.waitForTimeout(1000) + async clickZoweLink() { + await this.commonPage.waitForElement(this.zoweLink) await this.zoweLink.click(); } - async clickLicenseAgreement(){ - await this.page.waitForTimeout(1000) - await this.licenseAgreement.click({timeout: 5000}); + async clickLicenseAgreement() { + await this.commonPage.waitForElement(this.licenseAgreement) + await this.licenseAgreement.click({ timeout: 5000 }); } - async clickSaveAndClose(){ - await this.page.waitForTimeout(1000) - await this.saveAndClose.click({timeout: 5000}); + async clickSaveAndClose() { + await this.commonPage.waitForElement(this.saveAndClose) + await this.saveAndClose.click({ timeout: 5000 }); await this.page.waitForTimeout(2000) } - async clickPreviousStep(){ - await this.page.waitForTimeout(1000) + async clickPreviousStep() { + await this.commonPage.waitForElement(this.previousStep) await this.previousStep.click(); await this.page.waitForTimeout(2000) } - async clickContinueToInstallation(){ - await this.page.waitForTimeout(1000) + async clickContinueToInstallation() { + await this.commonPage.waitForElement(this.continueToComponentInstallation) await this.continueToComponentInstallation.click(); await this.page.waitForTimeout(5000); } - async isContinueToComponentInstallationDisabled(){ - await this.page.waitForTimeout(1000) + async isContinueToComponentInstallationDisabled() { + await this.commonPage.waitForElement(this.continueToComponentInstallation) return await this.continueToComponentInstallation.isDisabled() } - async isContinueToComponentInstallationEnabled(){ - await this.page.waitForTimeout(1000) + async isContinueToComponentInstallationEnabled() { + await this.commonPage.waitForElement(this.continueToComponentInstallation) return await this.continueToComponentInstallation.isEnabled() } - async clickAgreeLicense(){ - await this.page.waitForTimeout(1000) - await this.agreeLicense.click({timeout: 5000}); + async clickAgreeLicense() { + await this.commonPage.waitForElement(this.agreeLicense) + await this.agreeLicense.click({ timeout: 5000 }); } - async isLicenseAgreementGreenCheckVisible(){ - await this.page.waitForTimeout(1000) + async isLicenseAgreementGreenCheckVisible() { + await this.commonPage.waitForElement(this.licenseAgreementGreenCheck) return await this.licenseAgreementGreenCheck.isVisible(); } - async clickUploadPaxButton(){ - await this.page.waitForTimeout(1000) - await this.uploadPaxButton.click({timeout: 5000}); + async clickUploadPaxButton() { + await this.commonPage.waitForElement(this.uploadPaxButton) + await this.uploadPaxButton.click({ timeout: 5000 }); } - async enterRuntimeDir(runtimeDir: any){ - await this.page.waitForTimeout(1000) - await this.runtimeDir.clear({timeout: 5000}) + async enterRuntimeDir(runtimeDir: any) { + await this.commonPage.waitForElement(this.runtimeDir) + await this.runtimeDir.clear({ timeout: 5000 }) await this.runtimeDir.fill(runtimeDir); } - async clickValidateLocation(){ - await this.page.waitForTimeout(1000) - await this.validateLocation.click({timeout: 5000}); + async clickValidateLocation() { + await this.commonPage.waitForElement(this.validateLocation) + await this.validateLocation.click({ timeout: 5000 }); await this.page.waitForTimeout(2000) } - async isValidateLocationGreenCheckVisible(){ - await this.page.waitForTimeout(1000) + async isValidateLocationGreenCheckVisible() { + await this.commonPage.waitForElement(this.validateLocationGreenCheck) return await this.validateLocationGreenCheck.isVisible(); } - async downloadZowePaxAndNavigateToInstallationPage(){ + async downloadZowePaxAndNavigateToInstallationPage() { this.selectDownloadZowePax() this.clickLicenseAgreement() this.clickAgreeLicense() - } + } - async uploadZowePaxAndNavigateToInstallationPage(uploadPaxPath: any){ + async uploadZowePaxAndNavigateToInstallationPage(uploadPaxPath: any) { this.selectUploadZowePax() - await this.page.waitForTimeout(2000) + await this.commonPage.waitForElement(this.uploadPaxButton) await this.uploadPaxButton.setInputFiles(uploadPaxPath) await this.page.waitForTimeout(2000) - } + } - async smpeZowePaxAndNavigateToInstallationPage(runtimeDir: any){ + async smpeZowePaxAndNavigateToInstallationPage(runtimeDir: any) { this.selectSmpe() this.enterRuntimeDir(runtimeDir) this.clickValidateLocation() - } + } + } - export default InstallationTypePage; +export default InstallationTypePage; diff --git a/playwright_test/Pages/launchConfig.page.ts b/playwright_test/Pages/launchConfig.page.ts index c28440ac..6df3a9a3 100644 --- a/playwright_test/Pages/launchConfig.page.ts +++ b/playwright_test/Pages/launchConfig.page.ts @@ -1,7 +1,7 @@ -import { Page,ElectronApplication, Locator,_electron as electron } from '@playwright/test'; -let electronApp: ElectronApplication +import { Page, Locator } from '@playwright/test'; +import CommonPage from './common.page'; -class LaunchConfigPage{ +class LaunchConfigPage { page: Page; pageTitle: Locator; fillValidation: Locator; @@ -13,17 +13,22 @@ class LaunchConfigPage{ editor_title_element: Locator; licenseAgreement: Locator; acceptLicense: Locator; - skip_button:Locator; - view_yaml:Locator; - view_submit_job:Locator; - view_job_output:Locator; - save_and_close:Locator; - previous_step:Locator; - close_button:Locator; + skip_button: Locator; + view_yaml: Locator; + view_submit_job: Locator; + view_job_output: Locator; + save_and_close: Locator; + previous_step: Locator; + close_button: Locator; CONFPAGE_TITLE: Locator; continueToComponentInstallation: Locator; - - + click_launchConfig: Locator; + validation: Locator; + componentConfig: Locator; + fillConfigLaunchValue: Locator; + viewAndSubmitJob: Locator; + certificateTab_title: Locator; + errorMsg: Locator; constructor(page: Page) { this.page = page; @@ -43,10 +48,10 @@ class LaunchConfigPage{ this.licenseAgreement = page.locator('//button[contains(text(), "License Agreement")]') this.acceptLicense = page.locator('//html/body/div[2]/div[3]/div/div[2]/button[1]') this.continueToComponentInstallation = page.locator('//button[contains(text(), "Continue to Components Installation")]') - this.view_yaml = page.locator('//button[contains(text(),"View Yaml")]') - this.viewAndSubmitJob = page.locator('//button[contains(text(), "Preview Job")]') - this.view_job_output = page.locator('//button[contains(text(), "Submit Job")]') - this.save_and_close = page.locator('//button[contains(text(),"Save & close")]') + this.view_yaml = page.locator('//button[contains(text(),"View Yaml")]') + this.viewAndSubmitJob = page.locator('//button[contains(text(), "Preview Job")]') + 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_button = page.locator('//button[contains(text(),"Skip")]') this.close_button = page.locator('//button[contains(text(), "Close")]') @@ -55,152 +60,182 @@ class LaunchConfigPage{ this.errorMsg = page.locator('//p[text()="is a required property"]') } - async getLaunchConfigurationPageTitle(){ - await this.page.waitForTimeout(1000) + commonPage = new CommonPage(); + + async getLaunchConfigurationPageTitle() { + await this.commonPage.waitForElement(this.pageTitle) return await this.pageTitle.textContent({ timeout: 2000 }); } - async movetoLaunchConfigPage(){ - await this.licenseAgreement.click({timeout: 9000}) - await this.acceptLicense.click({timeout: 9000}) - await this.continueToComponentInstallation.click({timeout: 5000}) - await this.click_launchConfig.click({timeout: 5000}) + async movetoLaunchConfigPage() { + 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 }) + await this.commonPage.waitForElement(this.click_launchConfig) + await this.click_launchConfig.click({ timeout: 5000 }) } - async returnTitleOfConfPage(){ - const apfAuth_title = await this.CONFPAGE_TITLE.textContent(); - return apfAuth_title; + + async returnTitleOfConfPage() { + await this.commonPage.waitForElement(this.CONFPAGE_TITLE) + const apfAuth_title = await this.CONFPAGE_TITLE.textContent(); + return apfAuth_title; } - async fillvalues(validation:string){ - await this.page.fill('input[id="#/properties/configmgr/properties/validation"]', validation, { timeout: 10000 }); + + async fillvalues(validation: string) { + await this.page.fill('input[id="#/properties/configmgr/properties/validation"]', validation, { timeout: 10000 }); + } + + async fillvalues_logLevel(logLevel: string) { + await this.commonPage.waitForElement(this.fillLogLevel) + await this.fillLogLevel.clear({ timeout: 2000 }) + await this.fillLogLevel.fill(logLevel, { timeout: 10000 }) } - async fillvalues_logLevel(logLevel:string){ - await this.fillLogLevel.fill(logLevel,{ timeout: 10000 }) - } - async fillvaluescomponentConfig(componentConfig:string){ - await this.fillConfigLaunchValue.fill(componentConfig,{ timeout: 10000 }) + async fillvaluescomponentConfig(componentConfig: string) { + await this.commonPage.waitForElement(this.fillConfigLaunchValue) + await this.fillConfigLaunchValue.clear({ timeout: 2000 }) + await this.fillConfigLaunchValue.fill(componentConfig, { timeout: 10000 }) } - async get_validation_value(){ - const inputLocator = await this.page.locator('input[id="#/properties/configmgr/properties/validation"]'); - const value = await inputLocator.inputValue(); - console.log('Input field value:', value); - return value; + + async get_validation_value() { + const inputLocator = this.page.locator('input[id="#/properties/configmgr/properties/validation"]'); + await this.commonPage.waitForElement(inputLocator) + const value = await inputLocator.inputValue(); + return value; } - async get_validation_error_msg(){ - const errorText = await this.page.locator('//p[text()="is a required property"]').textContent(); - console.log(errorText); - return errorText; + async get_validation_error_msg() { + const errorText = await this.page.locator('//p[text()="is a required property"]').textContent(); + return errorText; } - async get_logLevel_value(){ - const value = await this.fillLogLevel.inputValue(); - console.log('Input field value:', value); - return value; + async get_logLevel_value() { + await this.commonPage.waitForElement(this.fillLogLevel) + const value = await this.fillLogLevel.inputValue(); + return value; } - async get_componentConfig_value(){ - const value = await this.fillConfigLaunchValue.inputValue(); - console.log('Input field value:', value); - return value; + + async get_componentConfig_value() { + const value = await this.fillConfigLaunchValue.inputValue(); + return value; } - async viewYaml(){ + async viewYaml() { + await this.commonPage.waitForElement(this.view_yaml) await this.view_yaml.click({ timeout: 5000 }) } - async closeButton(){ - this.close_button.click({ timeout: 2000 }) + + async closeButton() { + await this.commonPage.waitForElement(this.close_button) + this.close_button.click({ timeout: 2000 }) } - async click_viewAndSubmitJob(){ - this.viewAndSubmitJob.click({ timeout: 2000 }) + + async click_viewAndSubmitJob() { + await this.commonPage.waitForElement(this.viewAndSubmitJob) + this.viewAndSubmitJob.click({ timeout: 2000 }) } - async click_previewJob(){ - this.view_job_output.click({ timeout: 2000 }) + + async click_previewJob() { + await this.commonPage.waitForElement(this.view_job_output) + this.view_job_output.click({ timeout: 2000 }) } - async is_skipLaunchConfigButtonEnable(){ - return await this.skip_button.isEnabled({ timeout: 5000 }); + + async is_skipLaunchConfigButtonEnable() { + await this.commonPage.waitForElement(this.skip_button) + return await this.skip_button.isEnabled({ timeout: 5000 }); } - async click_skipLaunhConfig(){ - await this.skip_button.click({ timeout: 2000 }); - const certificatePage_title = await this.certificateTab_title.textContent(); - return certificatePage_title; + async click_skipLaunhConfig() { + await this.commonPage.waitForElement(this.skip_button) + await this.skip_button.click({ timeout: 2000 }); + await this.commonPage.waitForElement(this.certificateTab_title) + const certificatePage_title = await this.certificateTab_title.textContent(); + return certificatePage_title; } - async isPreviousButtonEnable(){ - return await this.previous_step.isEnabled({ timeout: 50000 }); + async isPreviousButtonEnable() { + await this.commonPage.waitForElement(this.previous_step) + return await this.previous_step.isEnabled({ timeout: 50000 }); } - async returnTitleOfPrevPage(){ - await this.previous_step_button.click({ timeout: 2000 }); - const certificate_title = await this.certificateTab_title.textContent(); - return certificate_title; + async returnTitleOfPrevPage() { + await this.commonPage.waitForElement(this.previous_step_button) + await this.previous_step_button.click({ timeout: 2000 }); + await this.commonPage.waitForElement(this.certificateTab_title) + const certificate_title = await this.certificateTab_title.textContent(); + return certificate_title; } - async open_monacoEditor(){ - this.view_yaml.click({ timeout: 5000 }) - const editor_title = await this.editor_title_element.textContent(); - return editor_title; + async open_monacoEditor() { + await this.commonPage.waitForElement(this.view_yaml) + this.view_yaml.click({ timeout: 5000 }) + await this.commonPage.waitForElement(this.editor_title_element) + const editor_title = await this.editor_title_element.textContent(); + return editor_title; } - - async clickContinueToReviewPage(){ - await this.page.waitForTimeout(500) + async clickContinueToReviewPage() { + await this.commonPage.waitForElement(this.continueToReviewPage) await this.continueToReviewPage.click(); } - async isContinueButtonDisable(){ - return await this.continueToReviewPage.isDisabled({ timeout: 5000 }); + async isContinueButtonDisable() { + await this.commonPage.waitForElement(this.continueToReviewPage) + return await this.continueToReviewPage.isDisabled({ timeout: 5000 }); } - async click_saveAndClose(){ - this.save_and_close.click({ timeout: 2000 }) + + async click_saveAndClose() { + await this.commonPage.waitForElement(this.save_and_close) + this.save_and_close.click({ timeout: 2000 }) } + async read_yaml() { let previousScrollHeight = 0; let allText = ''; while (true) { - // Extract text from all div.view-line elements - const newText = await this.page.evaluate(() => { - const viewLines = document.querySelectorAll('.view-lines .view-line'); - let text = ''; - viewLines.forEach((line) => { - text += line.textContent + '\n'; - }); - return text; + // Extract text from all div.view-line elements + const newText = await this.page.evaluate(() => { + const viewLines = document.querySelectorAll('.view-lines .view-line'); + let text = ''; + viewLines.forEach((line) => { + text += line.textContent + '\n'; }); - - // Append the new text to the existing text - allText += newText; - console.log(allText) - - // Scroll a little to load more content - await this.page.evaluate(() => { - const editor = document.querySelector('.monaco-scrollable-element.editor-scrollable.vs'); - editor.scrollTop += 100; // Adjust the scroll amount as needed - }); - - // Wait for a brief moment for new content to load - await this.page.waitForTimeout(1000); // Adjust timeout as needed - - // Get the current scroll height - const currentScrollHeight = await this.page.evaluate(() => { - const editor = document.querySelector('.monaco-scrollable-element.editor-scrollable.vs'); - return editor.scrollHeight; - }); - - // If the scroll height hasn't changed since the last iteration, we've reached the end - if (currentScrollHeight === previousScrollHeight) { - break; - } - - // Update the previous scroll height for the next iteration - previousScrollHeight = currentScrollHeight; + return text; + }); + + // Append the new text to the existing text + allText += newText; + + // Scroll a little to load more content + await this.page.evaluate(() => { + const editor = document.querySelector('.monaco-scrollable-element.editor-scrollable.vs'); + editor.scrollTop += 100; // Adjust the scroll amount as needed + }); + + // Wait for a brief moment for new content to load + await this.page.waitForTimeout(1000); // Adjust timeout as needed + + // Get the current scroll height + const currentScrollHeight = await this.page.evaluate(() => { + const editor = document.querySelector('.monaco-scrollable-element.editor-scrollable.vs'); + return editor.scrollHeight; + }); + + // If the scroll height hasn't changed since the last iteration, we've reached the end + if (currentScrollHeight === previousScrollHeight) { + break; + } + + // Update the previous scroll height for the next iteration + previousScrollHeight = currentScrollHeight; } - console.log('All text:', allText); return allText; -} - + } } - export default LaunchConfigPage; \ No newline at end of file +export default LaunchConfigPage; \ No newline at end of file diff --git a/playwright_test/Pages/networking.page.ts b/playwright_test/Pages/networking.page.ts index 6cd5ced6..5231de09 100644 --- a/playwright_test/Pages/networking.page.ts +++ b/playwright_test/Pages/networking.page.ts @@ -1,7 +1,7 @@ -import { Page,ElectronApplication, Locator,_electron as electron } from '@playwright/test'; -let electronApp: ElectronApplication +import { Page, Locator } from '@playwright/test'; +import CommonPage from './common.page'; -class NetworkingPage{ +class NetworkingPage { page: Page; fillValidation: Locator; logLevel: Locator; @@ -12,17 +12,76 @@ class NetworkingPage{ editor_title_element: Locator; licenseAgreement: Locator; acceptLicense: Locator; - skip_button:Locator; - view_yaml:Locator; - view_submit_job:Locator; - view_job_output:Locator; - save_and_close:Locator; - previous_step:Locator; - close_button:Locator; + skip_button: Locator; + view_yaml: Locator; + view_submit_job: Locator; + view_job_output: Locator; + save_and_close: Locator; + previous_step: Locator; + close_button: Locator; CONFPAGE_TITLE: Locator; continueToComponentInstallation: Locator; - - + addDomainField: Locator; + domainName: Locator; + click_networking: Locator; + fillExternalDomainValue: Locator; + externalDomains: Locator; + externalPort: Locator; + getExternalPortValue: Locator; + components: Locator; + metricService: Locator; + metricServiceEnbaled: Locator; + metricServiceDebug: Locator; + metricServicePort: Locator; + zss: Locator; + zssTls: Locator; + zssPort: Locator; + zssEnabled: Locator; + explorerUss: Locator; + explorerUssEnabled: Locator; + jobsApi: Locator; + jobsApiDebug: Locator; + jobsApiEnabled: Locator; + jobsApiPort: Locator; + filesApi: Locator; + filesApiDebug: Locator; + filesApiEnabled: Locator; + filesApiPort: Locator; + explorerMvs: Locator; + explorerMvsEnabled: Locator; + cloudGateway: Locator; + cloudGatewayDebug: Locator; + cloudGatewayEnabled: Locator; + cloudGatewayPort: Locator; + explorerJes: Locator; + explorerJesEnabled: Locator; + apiCatalog: Locator; + apiCatalogDebug: Locator; + apiCatalogEnabled: Locator; + apicatalogPort: Locator; + gateway: Locator; + gatewayDebug: Locator; + gatewayEnabled: Locator; + gatewayPort: Locator; + appServer: Locator; + appServerDebug: Locator; + appServerEnabled: Locator; + appServerPort: Locator; + cachingService: Locator; + cachingServiceDebug: Locator; + cachingServiceEnabled: Locator; + cachingServicePort: Locator; + discovery: Locator; + discoveryDebug: Locator; + discoveryEnabled: Locator; + discoveryPort: Locator; + metricService_debug_checkbox: Locator; + metricService_enabled_checkbox: Locator; + deleteDomainName: Locator; + NETWORKING_TITLE: Locator; + viewAndSubmitJob: Locator; + APFAUTH_TITLE: Locator; + installationTitle: Locator; constructor(page: Page) { this.page = page; @@ -80,7 +139,6 @@ class NetworkingPage{ this.discoveryDebug = page.locator('//*[@id="zen-root-container"]/div[2]/div/div[4]/div/form/div/div[2]/label[22]'); this.discoveryEnabled = page.locator('//*[@id="zen-root-container"]/div[2]/div/div[4]/div/form/div/div[2]/label[23]'); this.discoveryPort = page.locator('//*[@id=":r25:-label"]'); - this.metricService_debug_checkbox = page.locator('//*[@id="zen-root-container"]/div[2]/div/div[4]/div/form/div/div[2]/label[1]/span[1]/input'); this.metricService_enabled_checkbox = page.locator('//*[@id="zen-root-container"]/div[2]/div/div[4]/div/form/div/div[2]/label[2]/span[1]/input'); this.deleteDomainName = page.locator('//*[@id="zen-root-container"]/div[2]/div/div[4]/div/form/div/div[2]/div[2]/button'); @@ -92,10 +150,10 @@ class NetworkingPage{ this.licenseAgreement = page.locator('//button[contains(text(), "License Agreement")]'); this.acceptLicense = page.locator('//html/body/div[2]/div[3]/div/div[2]/button[1]'); this.continueToComponentInstallation = page.locator('//button[contains(text(), "Continue to Components Installation")]'); - this.view_yaml = page.locator('//button[contains(text(),"View Yaml")]'); - this.viewAndSubmitJob = page.locator('//button[contains(text(), "Preview Job")]'); - this.view_job_output = page.locator('//button[contains(text(), "Submit Job")]'); - this.save_and_close = page.locator('//button[contains(text(),"Save & close")]'); + this.view_yaml = page.locator('//button[contains(text(),"View Yaml")]'); + this.viewAndSubmitJob = page.locator('//button[contains(text(), "Preview Job")]'); + 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_button = page.locator('//button[contains(text(),"Skip")]'); this.close_button = page.locator('//button[contains(text(), "Close")]'); @@ -104,195 +162,233 @@ class NetworkingPage{ this.installationTitle = page.locator('//div[text()="Installation"]'); } - async movetoNetworkingPage(){ - await this.licenseAgreement.click({timeout: 9000}) - await this.acceptLicense.click({timeout: 9000}) - await this.page.waitForTimeout(5000) - await this.continueToComponentInstallation.click({timeout: 5000}) - await this.click_networking.click({timeout: 5000}) + commonPage = new CommonPage(); + + async movetoNetworkingPage() { + 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 }) + await this.commonPage.waitForElement(this.click_networking) + await this.click_networking.click({ timeout: 5000 }) } - async returnTitleOfNetworkingPage(){ - const networking_title = await this.NETWORKING_TITLE.textContent(); - return networking_title; + + async returnTitleOfNetworkingPage() { + await this.commonPage.waitForElement(this.NETWORKING_TITLE) + const networking_title = await this.NETWORKING_TITLE.textContent(); + return networking_title; } - async fillExternalDomainPort(port:string){ - await this.externalPort.fill(port, { timeout: 10000 }) + async fillExternalDomainPort(port: string, p0: { timeout: number; }) { + await this.commonPage.waitForElement(this.externalPort) + await this.externalPort.clear({ timeout: 2000 }) + await this.externalPort.fill(port, { timeout: 10000 }) } - async fillMetricServicePort(port:string){ - // Scroll down a bit - await this.page.evaluate(() => { + async fillMetricServicePort(port: string) { + // Scroll down a bit + await this.page.evaluate(() => { window.scrollBy(0, 200); }); - // Add a wait after scrolling - await this.page.waitForTimeout(5000); - await this.metricServicePort.fill(port, { timeout: 10000 }) + // Add a wait after scrolling + await this.commonPage.waitForElement(this.metricServicePort) + await this.metricServicePort.clear({ timeout: 2000 }) + await this.metricServicePort.fill(port, { timeout: 10000 }) } - async get_metricServiceport_value(){ - const value = await this.metricServicePort.inputValue(); - return value; + async get_metricServiceport_value() { + await this.commonPage.waitForElement(this.metricServicePort) + const value = await this.metricServicePort.inputValue(); + return value; } - async fillExternalDomainName(externalDomainName: string){ - await this.domainName.fill(externalDomainName, { timeout: 10000 }); + async fillExternalDomainName(externalDomainName: string, p0: { timeout: number; }) { + await this.commonPage.waitForElement(this.domainName) + await this.domainName.clear({ timeout: 2000 }) + await this.domainName.fill(externalDomainName, { timeout: 10000 }); } - async fillexternal_domainvalues(externalDomainName:string, port: string){ - await this.fillExternalDomainName(externalDomainName, { timeout: 10000 }); - await this.fillExternalDomainPort(port, { timeout: 10000 }) + async fillexternal_domainvalues(externalDomainName: string, port: string) { + await this.fillExternalDomainName(externalDomainName, { timeout: 10000 }); + await this.fillExternalDomainPort(port, { timeout: 10000 }) } - async get_externalDomainName_value(){ - const value = await this.domainName.inputValue(); - return value; + + async get_externalDomainName_value() { + await this.commonPage.waitForElement(this.domainName) + const value = await this.domainName.inputValue(); + return value; } - async get_externalDomainport_value(){ - const value = await this.getExternalPortValue.inputValue(); - return value; + + async get_externalDomainport_value() { + await this.commonPage.waitForElement(this.getExternalPortValue) + const value = await this.getExternalPortValue.inputValue(); + return value; } - async click_checkBox(n:string){ + async click_checkBox(n: string) { const xpathLocator = `//*[@id="zen-root-container"]/div[2]/div/div[4]/div/form/div/div[2]/label[${n}]/span[1]/input`; const checkbox = await this.page.waitForSelector(xpathLocator, { state: 'visible' }); if (checkbox) { - const isChecked = await checkbox.evaluate((input) => input.checked); - console.log('Is checkbox checked:', isChecked); - - if (!isChecked) { - await checkbox.click(); - console.log('Checkbox clicked'); - } else { - console.log('Checkbox is already checked'); - } + const isChecked = await checkbox.evaluate((input) => input.checked); + console.log('Is checkbox checked:', isChecked); + + if (!isChecked) { + await checkbox.click(); + console.log('Checkbox clicked'); + } else { + console.log('Checkbox is already checked'); + } } else { - console.log('Checkbox not found'); + console.log('Checkbox not found'); + } } -} - - async isCheckboxCheckedAndBlue(nthChild: string){ + async isCheckboxCheckedAndBlue(nthChild: string) { const xpathLocator = `//*[@id="zen-root-container"]/div[2]/div/div[4]/div/form/div/div[2]/label[${nthChild}]/span[1]/input`; const checkbox = await this.page.waitForSelector(xpathLocator); if (checkbox) { - // Check if the checkbox is clicked - const isChecked = await checkbox.evaluate((input) => input.checked); - console.log('Is checkbox clicked:', isChecked); - return isChecked; + // Check if the checkbox is clicked + const isChecked = await checkbox.evaluate((input) => input.checked); + console.log('Is checkbox clicked:', isChecked); + return isChecked; } else { - console.log('Checkbox not found'); - return false; + console.log('Checkbox not found'); + return false; } } - async delete_DomainNameField(){ - await this.deleteDomainName.click(); - } - async add_DomainNameField(){ + async delete_DomainNameField() { + await this.commonPage.waitForElement(this.deleteDomainName) + await this.deleteDomainName.click(); + } + + async add_DomainNameField() { + await this.commonPage.waitForElement(this.addDomainField) await this.addDomainField.click() } - async viewYaml(){ + + async viewYaml() { + await this.commonPage.waitForElement(this.view_yaml) await this.view_yaml.click({ timeout: 5000 }) } - async closeButton(){ - this.close_button.click({ timeout: 2000 }) + + async closeButton() { + await this.commonPage.waitForElement(this.close_button) + this.close_button.click({ timeout: 2000 }) } - async click_viewAndSubmitJob(){ - this.viewAndSubmitJob.click({ timeout: 2000 }) + + async click_viewAndSubmitJob() { + await this.commonPage.waitForElement(this.viewAndSubmitJob) + this.viewAndSubmitJob.click({ timeout: 2000 }) } - async click_previewJob(){ - this.view_job_output.click({ timeout: 2000 }) + + async click_previewJob() { + await this.commonPage.waitForElement(this.view_job_output) + this.view_job_output.click({ timeout: 2000 }) } - async is_skipNetworkingButtonEnable(){ - return await this.skip_button.isEnabled({ timeout: 5000 }); + + async is_skipNetworkingButtonEnable() { + await this.commonPage.waitForElement(this.skip_button) + return await this.skip_button.isEnabled({ timeout: 5000 }); } - async click_skipNetworking(){ - await this.skip_button.click({ timeout: 2000 }); - const apfAuth_title = await this.APFAUTH_TITLE.textContent(); - return apfAuth_title; + async click_skipNetworking() { + await this.commonPage.waitForElement(this.skip_button) + await this.skip_button.click({ timeout: 2000 }); + await this.commonPage.waitForElement(this.APFAUTH_TITLE) + const apfAuth_title = await this.APFAUTH_TITLE.textContent(); + return apfAuth_title; } - async isPreviousButtonEnable(){ - return await this.previous_step.isEnabled({ timeout: 50000 }); + async isPreviousButtonEnable() { + await this.commonPage.waitForElement(this.previous_step) + 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.commonPage.waitForElement(this.previous_step_button) + await this.previous_step_button.click({ timeout: 2000 }); + await this.commonPage.waitForElement(this.installationTitle) + const installation_title = await this.installationTitle.textContent(); + return installation_title; } - async open_monacoEditor(){ - this.view_yaml.click({ timeout: 5000 }) - const editor_title = await this.editor_title_element.textContent(); - return editor_title; + async open_monacoEditor() { + await this.commonPage.waitForElement(this.view_yaml) + this.view_yaml.click({ timeout: 5000 }) + await this.commonPage.waitForElement(this.editor_title_element) + const editor_title = await this.editor_title_element.textContent(); + return editor_title; } - async clickContinueToApfAuthSetup(){ - await this.page.waitForTimeout(500) + async clickContinueToApfAuthSetup() { + await this.commonPage.waitForElement(this.continueToApfAuthSetup) await this.continueToApfAuthSetup.click(); } - async isContinueButtonDisable(){ - return await this.continueToApfAuthSetup.isDisabled({ timeout: 5000 }); + async isContinueButtonDisable() { + await this.commonPage.waitForElement(this.continueToApfAuthSetup) + return await this.continueToApfAuthSetup.isDisabled({ timeout: 5000 }); } - async click_saveAndClose(){ - this.save_and_close.click({ timeout: 2000 }) + async click_saveAndClose() { + await this.commonPage.waitForElement(this.save_and_close) + this.save_and_close.click({ timeout: 2000 }) } + async read_yaml() { let previousScrollHeight = 0; let allText = ''; while (true) { - // Extract text from all div.view-line elements - const newText = await this.page.evaluate(() => { - const viewLines = document.querySelectorAll('.view-lines .view-line'); - let text = ''; - viewLines.forEach((line) => { - text += line.textContent + '\n'; - }); - return text; - }); - - // Append the new text to the existing text - allText += newText; - console.log(allText) - - // Scroll a little to load more content - await this.page.evaluate(() => { - const editor = document.querySelector('.monaco-scrollable-element.editor-scrollable.vs'); - editor.scrollTop += 100; // Adjust the scroll amount as needed - }); - - // Wait for a brief moment for new content to load - await this.page.waitForTimeout(1000); // Adjust timeout as needed - - // Get the current scroll height - const currentScrollHeight = await this.page.evaluate(() => { - const editor = document.querySelector('.monaco-scrollable-element.editor-scrollable.vs'); - return editor.scrollHeight; + // Extract text from all div.view-line elements + const newText = await this.page.evaluate(() => { + const viewLines = document.querySelectorAll('.view-lines .view-line'); + let text = ''; + viewLines.forEach((line) => { + text += line.textContent + '\n'; }); - - // If the scroll height hasn't changed since the last iteration, we've reached the end - if (currentScrollHeight === previousScrollHeight) { - break; - } - - // Update the previous scroll height for the next iteration - previousScrollHeight = currentScrollHeight; + return text; + }); + + // Append the new text to the existing text + allText += newText; + console.log(allText) + + // Scroll a little to load more content + await this.page.evaluate(() => { + const editor = document.querySelector('.monaco-scrollable-element.editor-scrollable.vs'); + editor.scrollTop += 100; // Adjust the scroll amount as needed + }); + + // Wait for a brief moment for new content to load + await this.page.waitForTimeout(1000); // Adjust timeout as needed + + // Get the current scroll height + const currentScrollHeight = await this.page.evaluate(() => { + const editor = document.querySelector('.monaco-scrollable-element.editor-scrollable.vs'); + return editor.scrollHeight; + }); + + // If the scroll height hasn't changed since the last iteration, we've reached the end + if (currentScrollHeight === previousScrollHeight) { + break; + } + + // Update the previous scroll height for the next iteration + previousScrollHeight = currentScrollHeight; } console.log('All text:', allText); return allText; -} - + } } - export default NetworkingPage; \ No newline at end of file +export default NetworkingPage; \ No newline at end of file diff --git a/playwright_test/Pages/planning.page.ts b/playwright_test/Pages/planning.page.ts index 63b8c87e..65f4f721 100644 --- a/playwright_test/Pages/planning.page.ts +++ b/playwright_test/Pages/planning.page.ts @@ -1,7 +1,7 @@ import { Locator, Page } from '@playwright/test'; -let page: Page; +import CommonPage from './common.page'; -class PlanningPage{ +class PlanningPage { page: Page; planningPageTitle: Locator; zoweInstallationLink: Locator; @@ -29,6 +29,7 @@ class PlanningPage{ continueInstallationOptions: Locator; readyToProceedMessage: Locator; errorMessage: Locator; + save_and_close: Locator; constructor(page: Page) { this.page = page; @@ -58,187 +59,222 @@ class PlanningPage{ this.continueInstallationOptions = page.locator("//button[contains(text(), 'Continue to Installation Options')]") this.readyToProceedMessage = page.locator("//div[contains(@class,'MuiBox-root css-hieomr')]/p") this.errorMessage = page.locator("//div[contains(@class,'MuiAlert-message')]") - this.save_and_close = page.locator('//button[contains(text(),"Save & close")]') + this.save_and_close = page.locator('//button[contains(text(),"Save & close")]') } - async clickZoweInstallationLink(){ - await this.page.waitForTimeout(500); + commonPage = new CommonPage(); + + async clickZoweInstallationLink() { + await this.commonPage.waitForElement(this.zoweInstallationLink) await this.zoweInstallationLink.click(); } - async getPlanningPageTitle(){ - await this.page.waitForTimeout(1000); + async getPlanningPageTitle() { + await this.commonPage.waitForElement(this.planningPageTitle) return await this.planningPageTitle.textContent(); } - async click_saveAndClose(){ - this.save_and_close.click({ timeout: 2000 }) + async click_saveAndClose() { + await this.commonPage.waitForElement(this.save_and_close) + this.save_and_close.click({ timeout: 2000 }) } - async enterJobStatement(jobStatement: string){ - await this.page.waitForTimeout(500); + async enterJobStatement(jobStatement: string) { + await this.commonPage.waitForElement(this.jobStatement) + await this.jobStatement.clear({ timeout: 2000 }); await this.jobStatement.fill(jobStatement); + await this.commonPage.validateElementValue(this.jobStatement, jobStatement) + return true } - async clickSaveAndValidate(){ - await this.page.waitForTimeout(1000); + async clickSaveAndValidate() { + await this.commonPage.waitForElement(this.saveAndValidate); await this.saveAndValidate.click({ timeout: 5000 }); } - async isSaveAndValidateGreenCheckVisible(){ - await this.page.waitForTimeout(1000); + async validateJobStatement(jobStatement: string) { + const jobStatementFilled = await this.enterJobStatement(jobStatement); + if (jobStatementFilled) { + this.clickSaveAndValidate(); + } else { + this.enterJobStatement(jobStatement); + this.clickSaveAndValidate(); + } + } + + async isSaveAndValidateGreenCheckVisible() { + await this.commonPage.waitForElement(this.saveAndValidateGreenCheck) return await this.saveAndValidateGreenCheck.isVisible({ timeout: 5000 }); } - async getErrorMessage(){ - await this.page.waitForTimeout(1000); + async getErrorMessage() { + await this.commonPage.waitForElement(this.errorMessage) return await this.errorMessage.textContent(); } - async enterRuntimeDir(runtimeDir: any){ - await this.page.waitForTimeout(500); - await this.runtimeDir.clear({timeout: 2000}) + async enterRuntimeDir(runtimeDir: any) { + await this.commonPage.waitForElement(this.runtimeDir) + await this.runtimeDir.clear({ timeout: 2000 }) await this.runtimeDir.fill(runtimeDir); + await this.commonPage.validateElementValue(this.runtimeDir, runtimeDir) } - async getrRuntimeDir(){ - const value = await this.runtimeDir.inputValue(); - return value; + async getrRuntimeDir() { + await this.commonPage.waitForElement(this.runtimeDir) + const value = await this.runtimeDir.inputValue(); + return value; } - async enterWorkspaceDir(workspaceDir: any){ - await this.page.waitForTimeout(500); - await this.workspaceDir.clear({timeout: 2000}) + async enterWorkspaceDir(workspaceDir: any) { + await this.commonPage.waitForElement(this.workspaceDir) + await this.workspaceDir.clear({ timeout: 2000 }) await this.workspaceDir.fill(workspaceDir); + await this.commonPage.validateElementValue(this.workspaceDir, workspaceDir) } - async enterLogsDir(logsDir: any){ - await this.page.waitForTimeout(500); - await this.logsDir.clear({timeout: 2000}) + async enterLogsDir(logsDir: any) { + await this.commonPage.waitForElement(this.logsDir) + await this.logsDir.clear({ timeout: 2000 }) await this.logsDir.fill(logsDir); + await this.commonPage.validateElementValue(this.logsDir, logsDir) } - async enterExtensionsDir(extensionsDir: any){ - await this.page.waitForTimeout(500); - await this.extensionsDir.clear({timeout: 2000}) + async enterExtensionsDir(extensionsDir: any) { + await this.commonPage.waitForElement(this.extensionsDir) + await this.extensionsDir.clear({ timeout: 2000 }) await this.extensionsDir.fill(extensionsDir); + await this.commonPage.validateElementValue(this.extensionsDir, extensionsDir) } - async enterRbacProfileIdentifier(rbacProfileIdentifier: any){ - await this.page.waitForTimeout(500); - await this.rbacProfileIdentifier.clear({timeout: 2000}) + async enterRbacProfileIdentifier(rbacProfileIdentifier: any) { + await this.commonPage.waitForElement(this.rbacProfileIdentifier) + await this.rbacProfileIdentifier.clear({ timeout: 2000 }) await this.rbacProfileIdentifier.fill(rbacProfileIdentifier); + await this.commonPage.validateElementValue(this.rbacProfileIdentifier, rbacProfileIdentifier) } - async enterJobName(jobName: any){ - await this.page.waitForTimeout(500); - await this.jobName.clear({timeout: 2000}) + async enterJobName(jobName: any) { + await this.commonPage.waitForElement(this.jobName) + await this.jobName.clear({ timeout: 2000 }) await this.jobName.fill(jobName); + await this.commonPage.validateElementValue(this.jobName, jobName) } - async enterJobPrefix(jobPrefix: any){ - await this.page.waitForTimeout(500); - await this.jobPrefix.clear({timeout: 2000}) + async enterJobPrefix(jobPrefix: any) { + await this.commonPage.waitForElement(this.jobPrefix) + await this.jobPrefix.clear({ timeout: 2000 }) await this.jobPrefix.fill(jobPrefix); + await this.commonPage.validateElementValue(this.jobPrefix, jobPrefix) } - async enterCookieIdentifier(cookieIdentifier: any){ - await this.page.waitForTimeout(500); - await this.cookieIdentifier.clear({timeout: 2000}) + async enterCookieIdentifier(cookieIdentifier: any) { + await this.commonPage.waitForElement(this.cookieIdentifier) + await this.cookieIdentifier.clear({ timeout: 2000 }) await this.cookieIdentifier.fill(cookieIdentifier); + await this.commonPage.validateElementValue(this.cookieIdentifier, cookieIdentifier) } - async enterJavaLocation(javaLocation: any){ - await this.page.waitForTimeout(500); - await this.javaLocation.clear({timeout: 2000}) + async enterJavaLocation(javaLocation: any) { + await this.commonPage.waitForElement(this.javaLocation) + await this.javaLocation.clear({ timeout: 2000 }) await this.javaLocation.fill(javaLocation); + await this.commonPage.validateElementValue(this.javaLocation, javaLocation) } - async enterNodeJsLocation(nodeJsLocation: any){ - await this.page.waitForTimeout(500); - await this.nodeJsLocation.clear({timeout: 2000}) + async enterNodeJsLocation(nodeJsLocation: any) { + await this.commonPage.waitForElement(this.nodeJsLocation) + await this.nodeJsLocation.clear({ timeout: 2000 }) await this.nodeJsLocation.fill(nodeJsLocation); + await this.commonPage.validateElementValue(this.nodeJsLocation, nodeJsLocation) } - async isSetZosmfAttributeChecked(){ - await this.page.waitForTimeout(1000); + async isSetZosmfAttributeChecked() { + await this.commonPage.waitForElement(this.setZosmf) return await this.setZosmf.isChecked(); } - async checkSetZosmfAttribute(){ - await this.page.waitForTimeout(1000); - if (await this.isSetZosmfAttributeChecked() == false){ + async checkSetZosmfAttribute() { + await this.commonPage.waitForElement(this.setZosmf) + if (await this.isSetZosmfAttributeChecked() == false) { await this.setZosmf.click(); } } - async enterZosmfHost(zosmfHost: any){ - await this.page.waitForTimeout(500); - await this.zosmfHost.clear({timeout: 2000}) + async enterZosmfHost(zosmfHost: any) { + await this.commonPage.waitForElement(this.zosmfHost) + await this.zosmfHost.clear({ timeout: 2000 }) await this.zosmfHost.fill(zosmfHost); - } - - async enterZosmfPort(zosmfPort: any){ - await this.page.waitForTimeout(500); - await this.zosmfPort.clear({timeout: 2000}) + await this.commonPage.validateElementValue(this.zosmfHost, zosmfHost) + } + + async enterZosmfPort(zosmfPort: any) { + await this.commonPage.waitForElement(this.zosmfPort) + await this.zosmfPort.clear({ timeout: 2000 }) await this.zosmfPort.fill(zosmfPort); + await this.commonPage.validateElementValue(this.zosmfPort, zosmfPort) } - async enterZosmfApplicationId(zosmfApplicationId: any){ - await this.page.waitForTimeout(500); - await this.zosmfApplicationId.clear({timeout: 2000}) + async enterZosmfApplicationId(zosmfApplicationId: any) { + await this.commonPage.waitForElement(this.zosmfApplicationId) + await this.zosmfApplicationId.clear({ timeout: 2000 }) await this.zosmfApplicationId.fill(zosmfApplicationId); + await this.commonPage.validateElementValue(this.zosmfApplicationId, zosmfApplicationId) } - async clickValidateLocations(){ - await this.page.waitForTimeout(500); - await this.validateLocations.click({timeout: 5000}); + async clickValidateLocations() { + await this.commonPage.waitForElement(this.validateLocations) + await this.validateLocations.click({ timeout: 5000 }); } - async isValidateLocationsGreenCheckVisible(){ - await this.page.waitForTimeout(500); + async isValidateLocationsGreenCheckVisible() { + await this.commonPage.waitForElement(this.ValidateLocationsGreenCheck) return await this.ValidateLocationsGreenCheck.isVisible(); } - async clickSaveAndClose(){ - await this.page.waitForTimeout(500); - await this.saveAndClose.click({timeout: 2000}); + async clickSaveAndClose() { + await this.commonPage.waitForElement(this.saveAndClose) + await this.saveAndClose.click({ timeout: 2000 }); } - async clickPreviousStep(){ - await this.page.waitForTimeout(500); + async clickPreviousStep() { + await this.commonPage.waitForElement(this.previousStep) await this.previousStep.click(); } - async clickContinueToInstallation(){ - await this.page.waitForTimeout(500); - await this.continueInstallationOptions.click(); + async clickContinueToInstallation() { + await this.commonPage.waitForElement(this.continueInstallationOptions) + await this.continueInstallationOptions.click(); } - async isContinueToInstallationDisabled(){ - await this.page.waitForTimeout(500); + async isContinueToInstallationDisabled() { + await this.commonPage.waitForElement(this.continueInstallationOptions) return await this.continueInstallationOptions.isDisabled() } - async getReadyToProceedMessage(){ - await this.page.waitForTimeout(1000); + async getReadyToProceedMessage() { + await this.commonPage.waitForElement(this.readyToProceedMessage) return await this.readyToProceedMessage.textContent({ timeout: 2000 }); } - async isContinueToInstallationEnabled(){ - await this.page.waitForTimeout(500); + async isContinueToInstallationEnabled() { + await this.commonPage.waitForElement(this.continueInstallationOptions) return await this.continueInstallationOptions.isEnabled() } - async clickSaveValidate(){ - await this.page.waitForTimeout(500); - await this.jobStatement.fill("//HELLOJOB JOB 'HELLO, WORLD!',CLASS=A,MSGCLASS=A\n//STEP01 EXEC PGM=IEFBR14\n//SYSPRINT DD SYSOUT=A\n//SYSIN DD DUMMY") - await this.saveAndValidate.click(); + async insertValidateJobStatement() { + const jobStatement = "//HELLOJOB JOB 'HELLO, WORLD!',CLASS=A,MSGCLASS=A\n//STEP01 EXEC PGM=IEFBR14\n//SYSPRINT DD SYSOUT=A\n//SYSIN DD DUMMY" + const jobStatementFilled = await this.enterJobStatement(jobStatement); + if (jobStatementFilled) { + this.clickSaveAndValidate(); + } else { + this.enterJobStatement(jobStatement); + this.clickSaveAndValidate(); + } } - async fillPlanningPageWithRequiredFields(runtimeDir: any, workspaceDir: any, extensionDir: any, logDir: any, profileIdentifier:any, jobPrefix:any,jobname:any, javaLocation:any,nodejsLocation:any,zOSMFHost:any,zOSMFPort:any,zOSMFAppID:any){ + + async fillPlanningPageWithRequiredFields(runtimeDir: any, workspaceDir: any, extensionDir: any, logDir: any, profileIdentifier: any, jobPrefix: any, jobname: any, javaLocation: any, nodejsLocation: any, zOSMFHost: any, zOSMFPort: any, zOSMFAppID: any) { await this.page.waitForTimeout(2000); - await this.clickSaveValidate(); await this.enterRuntimeDir(runtimeDir); await this.enterWorkspaceDir(workspaceDir); await this.enterLogsDir(logDir); @@ -252,7 +288,18 @@ class PlanningPage{ await this.enterZosmfPort(zOSMFPort); await this.enterZosmfApplicationId(zOSMFAppID); await this.page.waitForTimeout(2000); + return true + } + + async validatePlanningStageLocations(runtimeDir: any, workspaceDir: any, extensionDir: any, logDir: any, profileIdentifier: any, jobPrefix: any, jobname: any, javaLocation: any, nodejsLocation: any, zOSMFHost: any, zOSMFPort: any, zOSMFAppID: any) { + const planningDetailsFilled = await this.fillPlanningPageWithRequiredFields(runtimeDir, workspaceDir, extensionDir, logDir, profileIdentifier, jobPrefix, jobname, javaLocation, nodejsLocation, zOSMFHost, zOSMFPort, zOSMFAppID); + if (planningDetailsFilled) { + this.clickValidateLocations(); + } else { + this.fillPlanningPageWithRequiredFields(runtimeDir, workspaceDir, extensionDir, logDir, profileIdentifier, jobPrefix, jobname, javaLocation, nodejsLocation, zOSMFHost, zOSMFPort, zOSMFAppID); + this.clickValidateLocations(); + } } } - export default PlanningPage; \ No newline at end of file +export default PlanningPage; \ No newline at end of file diff --git a/playwright_test/Pages/review.page.ts b/playwright_test/Pages/review.page.ts index c11d21a2..1f33f143 100644 --- a/playwright_test/Pages/review.page.ts +++ b/playwright_test/Pages/review.page.ts @@ -1,6 +1,7 @@ -import { Page,Locator } from '@playwright/test'; +import { Page, Locator } from '@playwright/test'; +import CommonPage from './common.page'; -class ReviewPage{ +class ReviewPage { page: Page; pageTitle: Locator; reviewInstallationTab: Locator; @@ -41,8 +42,8 @@ class ReviewPage{ this.planningTab = page.locator("//p[text()='Planning']") this.installationTypeTab = page.locator("//p[text()='Installation Type']") this.initializationTab = page.locator("//p[text()='Initialization']") - this.installationTab = page.locator("//p[text()='Installation']") - this.networkingTab = page.locator("//p[text()='Networking']") + this.installationTab = page.locator("//p[text()='Installation']") + this.networkingTab = page.locator("//p[text()='Networking']") this.connectionTabSuccessfulIcon = page.locator("//p[text()='Connection']/following-sibling::*[@data-testid='CheckCircleIcon']") this.planningTabSuccessfulIcon = page.locator("//p[text()='Planning']/following-sibling::*[@data-testid='CheckCircleIcon']") this.installationTypeTabSuccessfulIcon = page.locator("//p[text()='Installation Type']/following-sibling::*[@data-testid='CheckCircleIcon']") @@ -53,126 +54,130 @@ class ReviewPage{ this.securityTabPendingIcon = page.locator("//p[text()='Security']/following-sibling::*[@data-testid='WarningIcon']") this.certificatesTabPendingIcon = page.locator("//p[text()='Certificates']/following-sibling::*[@data-testid='WarningIcon']") this.launchConfigTabPendingIcon = page.locator("//p[text()='Launch Config']/following-sibling::*[@data-testid='WarningIcon']") - this.apfAuthTab = page.locator("//p[text()='APF Auth']") - this.securityTab = page.locator("//p[text()='Security']") - this.certificatesTab = page.locator("//p[text()='Certificates']") - this.launchConfigTab = page.locator("//p[text()='Launch Config']") - this.viewEditYaml = page.locator("//button[text()='View 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.apfAuthTab = page.locator("//p[text()='APF Auth']") + this.securityTab = page.locator("//p[text()='Security']") + this.certificatesTab = page.locator("//p[text()='Certificates']") + this.launchConfigTab = page.locator("//p[text()='Launch Config']") + this.viewEditYaml = page.locator("//button[text()='View 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.finishInstallation = page.locator("//button[text()='Finish Installation']") + this.finishInstallation = page.locator("//button[text()='Finish Installation']") this.editorTitleElement = page.locator("//h2[text()='Editor']") this.closeEditorButton = page.locator("//button[text()='Close']") } - async getReviewPageTitle(){ - await this.page.waitForTimeout(1000) + commonPage = new CommonPage(); + + async getReviewPageTitle() { + await this.commonPage.waitForElement(this.pageTitle) return await this.pageTitle.textContent({ timeout: 2000 }); } - async clickReviewInstallationTab(){ - await this.page.waitForTimeout(500) + async clickReviewInstallationTab() { + await this.commonPage.waitForElement(this.reviewInstallationTab) await this.reviewInstallationTab.click(); } - async clickConnectionTab(){ - await this.page.waitForTimeout(500) + async clickConnectionTab() { + await this.commonPage.waitForElement(this.connectionTab) await this.connectionTab.click(); } - async clickPlanningTab(){ - await this.page.waitForTimeout(500) + async clickPlanningTab() { + await this.commonPage.waitForElement(this.planningTab) await this.planningTab.click(); } - async clickInstallationTypeTab(){ - await this.page.waitForTimeout(500) + async clickInstallationTypeTab() { + await this.commonPage.waitForElement(this.installationTypeTab) await this.installationTypeTab.click(); } - async clickInstallationTab(){ - await this.page.waitForTimeout(500) + async clickInstallationTab() { + await this.commonPage.waitForElement(this.installationTab) await this.installationTab.click(); } - async clickNetworkingTab(){ - await this.page.waitForTimeout(500) + async clickNetworkingTab() { + await this.commonPage.waitForElement(this.networkingTab) await this.networkingTab.click(); } - async clickApfAuthTab(){ - await this.page.waitForTimeout(500) + async clickApfAuthTab() { + await this.commonPage.waitForElement(this.apfAuthTab) await this.apfAuthTab.click(); } - async clickSecurityTab(){ - await this.page.waitForTimeout(500) + async clickSecurityTab() { + await this.commonPage.waitForElement(this.securityTab) await this.securityTab.click(); } - async clickCertificatesTab(){ - await this.page.waitForTimeout(500) + async clickCertificatesTab() { + await this.commonPage.waitForElement(this.certificatesTab) await this.certificatesTab.click(); } - async clickLaunchConfigTab(){ - await this.page.waitForTimeout(500) + async clickLaunchConfigTab() { + await this.commonPage.waitForElement(this.launchConfigTab) await this.launchConfigTab.click(); } - async clickViewEditYaml(){ - await this.page.waitForTimeout(500) + async clickViewEditYaml() { + await this.commonPage.waitForElement(this.viewEditYaml) await this.viewEditYaml.click(); } - async clickViewSubmitJob(){ - await this.page.waitForTimeout(500) + async clickViewSubmitJob() { + await this.commonPage.waitForElement(this.viewSubmitJob) await this.viewSubmitJob.click(); } - async clickViewJobOutput(){ - await this.page.waitForTimeout(500) + async clickViewJobOutput() { + await this.commonPage.waitForElement(this.viewJobOutput) await this.viewJobOutput.click(); await this.page.waitForTimeout(2000); } - async clickSaveAndClose(){ - await this.page.waitForTimeout(500) - await this.saveAndClose.click({timeout: 2000}); + async clickSaveAndClose() { + await this.commonPage.waitForElement(this.saveAndClose) + await this.saveAndClose.click({ timeout: 2000 }); } - async clickPreviousStep(){ - await this.page.waitForTimeout(500) + async clickPreviousStep() { + await this.commonPage.waitForElement(this.previousStep) await this.previousStep.click(); } - async clickFinishInstallation(){ - await this.page.waitForTimeout(500) + async clickFinishInstallation() { + await this.commonPage.waitForElement(this.finishInstallation) await this.finishInstallation.click(); } - async isFinishInstallationDisabled(){ - await this.page.waitForTimeout(500) + async isFinishInstallationDisabled() { + await this.commonPage.waitForElement(this.finishInstallation) return await this.finishInstallation.isDisabled() } - async isFinishInstallationEnabled(){ - await this.page.waitForTimeout(500) + async isFinishInstallationEnabled() { + await this.commonPage.waitForElement(this.finishInstallation) return await this.finishInstallation.isEnabled() } - async open_monacoEditor(){ - await this.page.waitForTimeout(1000) + 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.page.waitForTimeout(500) + async clickCloseEditor() { + await this.commonPage.waitForElement(this.closeEditorButton) await this.closeEditorButton.click(); } + } - export default ReviewPage; +export default ReviewPage; diff --git a/playwright_test/Pages/security.page.ts b/playwright_test/Pages/security.page.ts index 483991a2..3c4fb95d 100644 --- a/playwright_test/Pages/security.page.ts +++ b/playwright_test/Pages/security.page.ts @@ -1,7 +1,7 @@ -import { Page,ElectronApplication, Locator,_electron as electron } from '@playwright/test'; -let electronApp: ElectronApplication +import { Page, Locator } from '@playwright/test'; +import CommonPage from './common.page'; -class SecurityPage{ +class SecurityPage { page: Page; pageTitle: Locator; writeConfig_greenCheckXpath: Locator; @@ -12,27 +12,30 @@ class SecurityPage{ editor_title_element: Locator; licenseAgreement: Locator; acceptLicense: Locator; - skip_button:Locator; - view_yaml:Locator; - view_submit_job:Locator; - view_job_output:Locator; - save_and_close:Locator; - previous_step:Locator; - initSecurity:Locator; - close_button:Locator; - admin:Locator; - stc:Locator; - sys_prog:Locator; - user_zis:Locator; - user_zowe:Locator; - aux:Locator; - stc_zowe:Locator; - stc_zis:Locator; + skip_button: Locator; + view_yaml: Locator; + view_submit_job: Locator; + view_job_output: Locator; + save_and_close: Locator; + previous_step: Locator; + initSecurity: Locator; + close_button: Locator; + admin: Locator; + stc: Locator; + sys_prog: Locator; + user_zis: Locator; + user_zowe: Locator; + aux: Locator; + stc_zowe: Locator; + stc_zis: Locator; product: Locator; APFAUTH_TITLE: Locator; continueToComponentInstallation: Locator; certificateTab_title: Locator; - + mainXpath: string; + stc_mainXpath: string; + viewAndSubmitJob: Locator; + securityTab_title: Locator; constructor(page: Page) { this.page = page; @@ -50,10 +53,10 @@ class SecurityPage{ this.mainXpath = '//html/body/div/div[2]/div/div[4]/div/form/div/div[3]/div[1]/div[3]/div/div[2]/div/div/div' this.stc_mainXpath = '//html/body/div[1]/div[2]/div/div[4]/div/form/div/div[3]/div[1]/div[4]/div/div[2]/div/div/div/' this.product = page.locator('input[role="combobox"]') - 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.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_button = page.locator('//button[contains(text(),"Skip")]') this.initSecurity = page.locator("//button[contains(text(), 'Initialize Security Config')]") @@ -61,146 +64,215 @@ class SecurityPage{ this.certificateTab_title = page.locator('//div[text()="Certificates"]') this.securityTab_title = page.locator('//div[text()="Security"]') this.continue_CertificateSelector = page.locator('//button[contains(text(), "Continue to Certificates Setup")]') - this.admin = page.getByLabel('Admin'); - this.stc = page.getByLabel('Stc'); - this.sys_prog = page.getByLabel('Sys Prog'); - this.user_zis = page.locator(this.mainXpath +'/div/div/div[2]/div/div/input'); - this.user_zowe = page.locator(this.mainXpath +'/div/div/div[1]/div/div/input'); - this.aux = page.getByLabel('Aux'); - this.stc_zowe = page.locator(this.stc_mainXpath + 'div[1]/div/div[1]/div/div/input'); - this.stc_zis = page.locator(this.stc_mainXpath + 'div[1]/div/div[2]/div/div/input'); - + this.stc = page.getByLabel('Stc'); + this.sys_prog = page.getByLabel('Sys Prog'); + this.user_zis = page.locator(this.mainXpath + '/div/div/div[2]/div/div/input'); + this.user_zowe = page.locator(this.mainXpath + '/div/div/div[1]/div/div/input'); + this.aux = page.getByLabel('Aux'); + this.stc_zowe = page.locator(this.stc_mainXpath + 'div[1]/div/div[1]/div/div/input'); + this.stc_zis = page.locator(this.stc_mainXpath + 'div[1]/div/div[2]/div/div/input'); } - async getSecurityPageTitle(){ - await this.page.waitForTimeout(1000) + commonPage = new CommonPage(); + + async getSecurityPageTitle() { + await this.commonPage.waitForElement(this.pageTitle) return await this.pageTitle.textContent({ timeout: 2000 }); } - async movetoSecurityPage(){ - await this.licenseAgreement.click({timeout: 9000}) - await this.acceptLicense.click({timeout: 9000}) - await this.continueToComponentInstallation.click({timeout: 5000}) - await this.skip_button.click() - await this.skip_button.click() + async movetoSecurityPage() { + 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 }) + await this.commonPage.waitForElement(this.skip_button) + await this.skip_button.click() + await this.commonPage.waitForElement(this.skip_button) + await this.skip_button.click() } - async fillProduct(product:string){ - await this.product.fill(product,{ timeout: 10000 }) + + async fillProduct(product: string) { + await this.commonPage.waitForElement(this.product) + await this.product.clear({ timeout: 2000 }) + await this.product.fill(product, { timeout: 10000 }) } - async fillSecurityDetails(product:string, admin:string,stc:string,sys_prog:string,user_zis:string,user_zowe:string,aux: string, stc_zowe: string, stc_zis:string){ - await this.product.fill(product,{ timeout: 10000 }) - await this.page.waitForTimeout(8000); - await this.admin.fill(admin,{ timeout: 10000 }) - await this.stc.fill(stc,{ timeout: 10000 }) - await this.sys_prog.fill(sys_prog,{ timeout: 10000 }) - await this.page.waitForTimeout(8000); - await this.user_zis.fill(user_zis,{ timeout: 10000 }) - await this.user_zowe.fill(user_zowe,{ timeout: 10000 }) - await this.page.waitForTimeout(8000); - await this.aux.fill(aux,{ timeout: 10000 }) - await this.stc_zowe.fill(stc_zowe,{ timeout: 10000 }) - await this.stc_zis.fill(stc_zis,{ timeout: 10000 }) + + async fillSecurityDetails(product: string, admin: string, stc: string, sys_prog: string, user_zis: string, user_zowe: string, aux: string, stc_zowe: string, stc_zis: string) { + await this.commonPage.waitForElement(this.product) + await this.product.clear({ timeout: 2000 }) + await this.product.fill(product, { timeout: 10000 }) + await this.commonPage.waitForElement(this.admin) + await this.admin.clear({ timeout: 2000 }) + await this.admin.fill(admin, { timeout: 10000 }) + await this.commonPage.waitForElement(this.stc) + await this.stc.clear({ timeout: 2000 }) + await this.stc.fill(stc, { timeout: 10000 }) + await this.commonPage.waitForElement(this.sys_prog) + await this.sys_prog.clear({ timeout: 2000 }) + await this.sys_prog.fill(sys_prog, { timeout: 10000 }) + await this.commonPage.waitForElement(this.user_zis) + await this.user_zis.clear({ timeout: 2000 }) + await this.user_zis.fill(user_zis, { timeout: 10000 }) + await this.commonPage.waitForElement(this.user_zowe) + await this.user_zowe.clear({ timeout: 2000 }) + await this.user_zowe.fill(user_zowe, { timeout: 10000 }) + await this.commonPage.waitForElement(this.aux) + await this.aux.clear({ timeout: 2000 }) + await this.aux.fill(aux, { timeout: 10000 }) + await this.commonPage.waitForElement(this.stc_zowe) + await this.stc_zowe.clear({ timeout: 2000 }) + await this.stc_zowe.fill(stc_zowe, { timeout: 10000 }) + await this.commonPage.waitForElement(this.stc_zis) + await this.stc_zis.clear({ timeout: 2000 }) + await this.stc_zis.fill(stc_zis, { timeout: 10000 }) } - async fillAdmin(admin:string){ - await this.admin.fill(admin,{ timeout: 10000 }) + async fillAdmin(admin: string) { + await this.commonPage.waitForElement(this.admin) + await this.admin.clear({ timeout: 2000 }) + await this.admin.fill(admin, { timeout: 10000 }) } - async initializeSecurity(){ - await this.initSecurity.click() + async initializeSecurity() { + await this.commonPage.waitForElement(this.initSecurity) + await this.initSecurity.click() } - async isWriteConfigGreenCheckVisible(){ - return await this.writeConfig_greenCheckXpath.isVisible({ timeout: 50000 }); + + async isWriteConfigGreenCheckVisible() { + await this.commonPage.waitForElement(this.writeConfig_greenCheckXpath) + return await this.writeConfig_greenCheckXpath.isVisible({ timeout: 50000 }); } - async isUploadConfigGreenCheckVisible(){ - await this.uploadYaml_greenCheckXpath.waitFor({ timeout: 50000 }); - return await this.uploadYaml_greenCheckXpath.isVisible({ timeout: 50000 }); + + async isUploadConfigGreenCheckVisible() { + await this.commonPage.waitForElement(this.uploadYaml_greenCheckXpath) + return await this.uploadYaml_greenCheckXpath.isVisible({ timeout: 50000 }); } - async isInitSecurityGreenCheckVisible(){ - await this.init_security_greenCheckXpath.waitFor({ timeout: 50000 }); - return await this.init_security_greenCheckXpath.isVisible({ timeout: 50000 }); + + async isInitSecurityGreenCheckVisible() { + await this.commonPage.waitForElement(this.init_security_greenCheckXpath) + return await this.init_security_greenCheckXpath.isVisible({ timeout: 50000 }); } - async isPreviousButtonEnable(){ - return await this.previous_step.isEnabled({ timeout: 50000 }); + + async isPreviousButtonEnable() { + await this.commonPage.waitForElement(this.previous_step) + return await this.previous_step.isEnabled({ timeout: 50000 }); } - async returnTitleOfPrevPage(){ - await this.previous_step_button.click({ timeout: 2000 }); - const apfAuth_title = await this.APFAUTH_TITLE.textContent(); - return apfAuth_title; + async returnTitleOfPrevPage() { + await this.commonPage.waitForElement(this.previous_step_button) + await this.previous_step_button.click({ timeout: 2000 }); + await this.commonPage.waitForElement(this.APFAUTH_TITLE) + const apfAuth_title = await this.APFAUTH_TITLE.textContent(); + return apfAuth_title; } - async viewYaml(){ + + async viewYaml() { + await this.commonPage.waitForElement(this.view_yaml) await this.view_yaml.click({ timeout: 2000 }) } - async closeButton(){ - this.close_button.click({ timeout: 2000 }) + + async closeButton() { + await this.commonPage.waitForElement(this.close_button) + this.close_button.click({ timeout: 2000 }) } - async click_viewAndSubmitJob(){ - this.viewAndSubmitJob.click({ timeout: 2000 }) + + async click_viewAndSubmitJob() { + await this.commonPage.waitForElement(this.viewAndSubmitJob) + this.viewAndSubmitJob.click({ timeout: 2000 }) } - async click_previewJob(){ - this.view_job_output.click({ timeout: 2000 }) + + async click_previewJob() { + await this.commonPage.waitForElement(this.view_job_output) + this.view_job_output.click({ timeout: 2000 }) } - async is_skipSecurityButtonEnable(){ - return await this.skip_button.isEnabled({ timeout: 5000 }); + + async is_skipSecurityButtonEnable() { + await this.commonPage.waitForElement(this.skip_button) + return await this.skip_button.isEnabled({ timeout: 5000 }); } - async click_skipSecurity(){ - await this.skip_button.click({ timeout: 2000 }); - const certificatePage_title = await this.certificateTab_title.textContent(); - return certificatePage_title; + async click_skipSecurity() { + await this.commonPage.waitForElement(this.skip_button) + await this.skip_button.click({ timeout: 2000 }); + await this.commonPage.waitForElement(this.certificateTab_title) + const certificatePage_title = await this.certificateTab_title.textContent(); + return certificatePage_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() { + await this.commonPage.waitForElement(this.view_yaml) + this.view_yaml.click({ timeout: 2000 }) + await this.commonPage.waitForElement(this.editor_title_element) + const editor_title = await this.editor_title_element.textContent(); + return editor_title; } - async isContinueButtonDisable(){ - return await this.continue_CertificateSelector.isDisabled({ timeout: 5000 }); + async isContinueButtonDisable() { + await this.commonPage.waitForElement(this.continue_CertificateSelector) + return await this.continue_CertificateSelector.isDisabled({ timeout: 5000 }); } - async click_saveAndClose(){ - this.save_and_close.click({ timeout: 2000 }) + + async click_saveAndClose() { + await this.commonPage.waitForElement(this.save_and_close) + this.save_and_close.click({ timeout: 2000 }) } - async get_admin_value(){ - const admin_value = await this.admin.textContent(); - return admin_value; + + async get_admin_value() { + await this.commonPage.waitForElement(this.admin) + const admin_value = await this.admin.textContent(); + return admin_value; } - async get_stc_value(){ - const stc_value = await this.stc.textContent(); - return stc_value; + + async get_stc_value() { + await this.commonPage.waitForElement(this.stc) + const stc_value = await this.stc.textContent(); + return stc_value; } - async get_user_zowe_value(){ - const userZowe_value = await this.user_zowe.textContent(); - return userZowe_value; + + async get_user_zowe_value() { + await this.commonPage.waitForElement(this.user_zowe) + const userZowe_value = await this.user_zowe.textContent(); + return userZowe_value; } - async get_user_zis_value(){ - const userZis_value = await this.user_zis.textContent(); - return userZis_value; + + async get_user_zis_value() { + await this.commonPage.waitForElement(this.user_zis) + const userZis_value = await this.user_zis.textContent(); + return userZis_value; } - async get_aux_value(){ - const aux_value = await this.aux.textContent(); - return aux_value; + + async get_aux_value() { + await this.commonPage.waitForElement(this.aux) + const aux_value = await this.aux.textContent(); + return aux_value; } - async get_stc_zis_value(){ - const stcZis_value = await this.stc_zis.textContent(); - return stcZis_value; + + async get_stc_zis_value() { + await this.commonPage.waitForElement(this.stc_zis) + const stcZis_value = await this.stc_zis.textContent(); + return stcZis_value; } - async get_stc_zowe_value(){ - const stcZowe_value = await this.stc_zowe.textContent(); - return stcZowe_value; + + async get_stc_zowe_value() { + await this.commonPage.waitForElement(this.stc_zowe) + const stcZowe_value = await this.stc_zowe.textContent(); + return stcZowe_value; } - async get_sysProg_value(){ - const sysProg_value = await this.sys_prog.textContent(); - return sysProg_value; + async get_sysProg_value() { + await this.commonPage.waitForElement(this.sys_prog) + const sysProg_value = await this.sys_prog.textContent(); + return sysProg_value; } - async returnTitleOfSecurityPage(){ - const securityPage_title = await this.securityTab_title.textContent(); - return securityPage_title; + + async returnTitleOfSecurityPage() { + await this.commonPage.waitForElement(this.securityTab_title) + const securityPage_title = await this.securityTab_title.textContent(); + return securityPage_title; } } - export default SecurityPage; \ No newline at end of file +export default SecurityPage; \ No newline at end of file diff --git a/playwright_test/Pages/title.page.ts b/playwright_test/Pages/title.page.ts index 0cb0a10a..0b26fb63 100644 --- a/playwright_test/Pages/title.page.ts +++ b/playwright_test/Pages/title.page.ts @@ -1,4 +1,5 @@ -import { Page,Locator } from '@playwright/test'; +import { Page, Locator } from '@playwright/test'; +import CommonPage from './common.page'; class TitlePage { page: Page; @@ -13,14 +14,17 @@ class TitlePage { this.resumeProgressButton = page.locator("//button[text()='Resume Progress']") } - async navigateToConnectionTab(){ - await this.zoweInstallButton.click({timeout: 9000}) - } - - async clickOnResumeProgress(){ - await this.resumeProgressButton.click({timeout: 3000}) + commonPage = new CommonPage(); + + async navigateToConnectionTab() { + await this.commonPage.waitForElement(this.zoweInstallButton) + await this.zoweInstallButton.click({ timeout: 9000 }) } + async clickOnResumeProgress() { + await this.commonPage.waitForElement(this.resumeProgressButton) + await this.resumeProgressButton.click({ timeout: 3000 }) + } } - export default TitlePage; \ No newline at end of file +export default TitlePage; \ No newline at end of file diff --git a/playwright_test/Tests/ApfAuth.spec.ts b/playwright_test/Tests/ApfAuth.spec.ts index 502aa09c..59470b5e 100644 --- a/playwright_test/Tests/ApfAuth.spec.ts +++ b/playwright_test/Tests/ApfAuth.spec.ts @@ -4,229 +4,223 @@ import ApfAuthPage from '../Pages/ApfAuth.page'; import TitlePage from '../Pages/title.page'; import ConnectionPage from '../Pages/connection.page'; import PlanningPage from '../Pages/planning.page'; -import { spawn } from 'child_process'; -import path from 'path'; -let page: Page; - +import SecurityPage from '../Pages/security.page.js'; let electronApp: ElectronApplication -const APF_AUTH_TITLE ='APF Authorize Load Libraries' +const APF_AUTH_TITLE = 'APF Authorize Load Libraries' const NETWORKING_TITLE = 'Networking' -const INSTALLATION_TITLE = 'Installation' const SECURITY_TITLE = 'Security' const DATASET_PREFIX = 'IBMUSER.ZWEV1' const AUTH_LOAD_LIB = 'IBMUSER.ZWEV1.ZWEAUTH' const AUTH_PLUGIN_LIB = 'IBMUSER.ZWEV1.CUST.ZWESAPL' const SSH_HOST = process.env.SSH_HOST; -const SSH_PASSWD = process.env.SSH_PASSWD; +const SSH_PASSWD = process.env.SSH_PASSWD; const SSH_PORT = process.env.SSH_PORT; const SSH_USER = process.env.SSH_USER; -const ZOWE_EXTENSION_DIR= process.env.ZOWE_EXTENSION_DIR; -const ZOWE_LOG_DIR=process.env.ZOWE_LOG_DIR; -const ZOWE_ROOT_DIR=process.env.ZOWE_ROOT_DIR; -const ZOWE_WORKSPACE_DIR=process.env.ZOWE_WORKSPACE_DIR; -const JOB_NAME= process.env.JOB_NAME; -const JOB_PREFIX=process.env.JOB_PREFIX; -const JAVA_HOME=process.env.JAVA_HOME; -const NODE_HOME=process.env.NODE_HOME; -const ZOSMF_HOST=process.env.ZOSMF_HOST; -const ZOSMF_PORT=process.env.ZOSMF_PORT; -const ZOSMF_APP_ID=process.env.ZOSMF_APP_ID; +const ZOWE_EXTENSION_DIR = process.env.ZOWE_EXTENSION_DIR; +const ZOWE_LOG_DIR = process.env.ZOWE_LOG_DIR; +const ZOWE_ROOT_DIR = process.env.ZOWE_ROOT_DIR; +const ZOWE_WORKSPACE_DIR = process.env.ZOWE_WORKSPACE_DIR; +const JOB_NAME = process.env.JOB_NAME; +const JOB_PREFIX = process.env.JOB_PREFIX; +const JAVA_HOME = process.env.JAVA_HOME; +const NODE_HOME = process.env.NODE_HOME; +const ZOSMF_HOST = process.env.ZOSMF_HOST; +const ZOSMF_PORT = process.env.ZOSMF_PORT; +const ZOSMF_APP_ID = process.env.ZOSMF_APP_ID; test.beforeAll(async () => { try { await prepareEnvironment({ install: true, remove: false }); } catch (error) { console.error('Error during environment preparation:', error); - process.exit(1); + process.exit(1); } }); test.describe('ApfAuthTab', () => { - let connectionPage: ConnectionPage; - let titlePage : TitlePage; - let apfAuthPage : ApfAuthPage; - let planningPage : PlanningPage; - - test.beforeEach(async ({ page }) => { - test.setTimeout(900000); - electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) - page= await electronApp.firstWindow() - connectionPage = new ConnectionPage(page); - titlePage = new TitlePage(page); - planningPage = new PlanningPage(page) - apfAuthPage = new ApfAuthPage(page); - titlePage.navigateToConnectionTab() - connectionPage.fillConnectionDetails(SSH_HOST,SSH_PORT,SSH_USER,SSH_PASSWD) - connectionPage.SubmitValidateCredential() - await page.waitForTimeout(5000); - connectionPage.clickContinueButton() - planningPage.clickSaveValidate() - await page.waitForTimeout(20000); - planningPage.fillPlanningPageWithRequiredFields(ZOWE_ROOT_DIR, ZOWE_WORKSPACE_DIR,ZOWE_EXTENSION_DIR,ZOWE_LOG_DIR,'1',JOB_NAME,JOB_PREFIX,JAVA_HOME,NODE_HOME,ZOSMF_HOST,ZOSMF_PORT,ZOSMF_APP_ID) - await page.waitForTimeout(20000); - planningPage.clickValidateLocations() - await page.waitForTimeout(30000); - planningPage.clickContinueToInstallation() - await page.waitForTimeout(5000); - apfAuthPage.movetoInstallationPage() - await page.waitForTimeout(5000); - }) - - test.afterEach(async () => { - await electronApp.close() - }) - test('Test Resume Progress', async ({ page }) => { - await page.waitForTimeout(8000); - apfAuthPage.fillApfDetails(DATASET_PREFIX,AUTH_LOAD_LIB,AUTH_PLUGIN_LIB) - await page.waitForTimeout(5000); - apfAuthPage.click_saveAndClose() - await page.waitForTimeout(8000); - connectionPage.click_resumeProgress() - await page.waitForTimeout(8000); - const title = await apfAuthPage.getApfAuthPageTitle(); - expect(title).toBe(APF_AUTH_TITLE); - const datatsetPrefixValue = await apfAuthPage.get_datasetPrefix_value(); - const AuthLoadLib_Value = await apfAuthPage.get_authLoadLib_value(); - const AuthPluginLib_Value = await apfAuthPage.get_authPluginLib_value(); - expect(datatsetPrefixValue).toBe(DATASET_PREFIX); - expect(AuthLoadLib_Value).toBe(AUTH_LOAD_LIB); - expect(AuthPluginLib_Value).toBe(AUTH_PLUGIN_LIB); - }) - - test('Verify title', async ({ page }) => { - await page.waitForTimeout(5000); - apfAuthPage.fillApfDetails(DATASET_PREFIX,AUTH_LOAD_LIB,AUTH_PLUGIN_LIB) - await page.waitForTimeout(5000); - apfAuthPage.movetoApfAuthPage() - await page.waitForTimeout(5000); - await expect(apfAuthPage.datasetPrefix).toBeTruthy() - await expect(apfAuthPage.authLoadLib).toBeTruthy() - await expect(apfAuthPage.authpluginLib).toBeTruthy() - await expect(apfAuthPage.run_zwe_init_apfauth).toBeTruthy() - await expect(apfAuthPage.view_yaml).toBeTruthy() - await expect(apfAuthPage.save_and_close).toBeTruthy() - await expect(apfAuthPage.previous_step).toBeTruthy() - await expect(apfAuthPage.skip_apf_auth).toBeTruthy() - await expect(apfAuthPage.continue_security_setup).toBeTruthy() - - }) - test('test apfAuth with empty data', async ({ page }) => { - await page.waitForTimeout(5000); - apfAuthPage.fillApfDetails('','','') - await page.waitForTimeout(5000); - apfAuthPage.movetoApfAuthPage() - await page.waitForTimeout(5000); - apfAuthPage.initializeApfauth() - await page.waitForTimeout(5000); - const isWriteConfig_check_visible = await apfAuthPage.isWriteConfigGreenCheckVisible(); - expect(isWriteConfig_check_visible).toBe(false); - const isUploadConfig_check_visible = await apfAuthPage.isUploadConfig_check_visible(); - expect(isUploadConfig_check_visible).toBe(false); - const isInitApf_check_visible = await apfAuthPage.isInitApf_check_visible(); - expect(isInitApf_check_visible).toBe(false); - }) - test('test apfAuth with valid data', async ({ page }) => { - await page.waitForTimeout(5000); - apfAuthPage.fillApfDetails(DATASET_PREFIX,AUTH_LOAD_LIB,AUTH_PLUGIN_LIB) - await page.waitForTimeout(5000); - apfAuthPage.movetoApfAuthPage() - await page.waitForTimeout(5000); - apfAuthPage.initializeApfauth() - await page.waitForTimeout(5000); - const isWriteConfig_check_visible = await apfAuthPage.isWriteConfigGreenCheckVisible(); - expect(isWriteConfig_check_visible).toBe(true); - const isUploadConfig_check_visible = await apfAuthPage.isUploadConfig_check_visible(); - expect(isUploadConfig_check_visible).toBe(true); - const isInitApf_check_visible = await apfAuthPage.isInitApf_check_visible(); - expect(isInitApf_check_visible).toBe(true); - }) - - test('click Previous step', async ({ page }) => { - await page.waitForTimeout(5000); - apfAuthPage.movetoApfAuthPage() - const title = await apfAuthPage.returnTitleOfPrevPage(); - expect(title).toBe(NETWORKING_TITLE); - }) - - test('test skip apfAuth button is enable', async ({ page }) => { - apfAuthPage.movetoApfAuthPage() - const isSkipApfAuthEnable = await apfAuthPage.is_skipApfAuthButtonEnable(); - expect(isSkipApfAuthEnable).toBe(true); - await page.waitForTimeout(2000); - }) - - test('test previous button is enabled', async ({ page }) => { - apfAuthPage.movetoApfAuthPage() - const is_prevButtonEnable = await apfAuthPage.isPreviousButtonEnable(); - expect(is_prevButtonEnable).toBe(true); - await page.waitForTimeout(2000); - }) - - test('test continue button is disable', async ({ page }) => { - apfAuthPage.movetoApfAuthPage() - const is_ContinueButtonDisable = await apfAuthPage.isContinueButtonDisable(); - expect(is_ContinueButtonDisable).toBe(true); - await page.waitForTimeout(2000); - }) - - test('click view yaml button', async ({ page }) => { - apfAuthPage.movetoApfAuthPage() - await page.waitForTimeout(5000); - apfAuthPage.viewYaml() - await page.waitForTimeout(5000); - await expect(apfAuthPage.editor_title_element).toBeTruthy(); - apfAuthPage.closeButton() - await page.waitForTimeout(2000); - }) - - test('test click skip APFAuth button', async ({ page }) => { - await apfAuthPage.movetoApfAuthPage() - const security_title = await apfAuthPage.click_skipApfAuth(); - expect(security_title).toBe(SECURITY_TITLE); - - }) - - test('Test view and submit button', async ({ page }) => { - apfAuthPage.movetoApfAuthPage() - await page.waitForTimeout(5000); - apfAuthPage.click_viewAndSubmitJob() - await page.waitForTimeout(5000); - await expect(apfAuthPage.editor_title_element).toBeTruthy() - apfAuthPage.closeButton() - await page.waitForTimeout(2000); - }) - - - test('Test view job', async ({ page }) => { - apfAuthPage.movetoApfAuthPage() - await page.waitForTimeout(5000); - apfAuthPage.click_previewJob() - await page.waitForTimeout(5000); - await expect(apfAuthPage.editor_title_element).toBeTruthy() - apfAuthPage.closeButton() - await page.waitForTimeout(5000); - }) - - test('Test save and close and Resume Progress', async ({ page }) => { - await page.waitForTimeout(5000); - apfAuthPage.fillApfDetails(DATASET_PREFIX,AUTH_LOAD_LIB,AUTH_PLUGIN_LIB) - await page.waitForTimeout(5000); - apfAuthPage.movetoApfAuthPage() - await page.waitForTimeout(5000); - apfAuthPage.click_saveAndClose() - await page.waitForTimeout(3000); - titlePage.clickOnResumeProgress(); - await page.waitForTimeout(15000); - const title = await securityPage.returnTitleOfSecurityPage(); - expect(title).toBe(SECURITY_TITLE); - const datatsetPrefixValue = await apfAuthPage.get_datasetPrefix_value(); - const authPluginLibValue = await apfAuthPage.get_authPluginLib_value(); - const authLoadLibValue = await apfAuthPage.get_authLoadLib_value(); - expect(datatsetPrefixValue).toBe(DATASET_PREFIX); - expect(authLoadLibValue).toBe(AUTH_LOAD_LIB); - expect(authPluginLibValue).toBe(AUTH_PLUGIN_LIB); - }) - - + let connectionPage: ConnectionPage; + let titlePage: TitlePage; + let apfAuthPage: ApfAuthPage; + let planningPage: PlanningPage; + let securityPage: SecurityPage; + + test.beforeEach(async ({ page }) => { + test.setTimeout(900000); + electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) + page = await electronApp.firstWindow() + connectionPage = new ConnectionPage(page); + titlePage = new TitlePage(page); + planningPage = new PlanningPage(page) + apfAuthPage = new ApfAuthPage(page); + titlePage.navigateToConnectionTab() + connectionPage.performLogin(SSH_HOST, SSH_PORT, SSH_USER, SSH_PASSWD) + await page.waitForTimeout(5000); + connectionPage.clickContinueButton() + planningPage.insertValidateJobStatement() + await page.waitForTimeout(20000); + planningPage.validatePlanningStageLocations(ZOWE_ROOT_DIR, ZOWE_WORKSPACE_DIR, ZOWE_EXTENSION_DIR, ZOWE_LOG_DIR, '1', JOB_NAME, JOB_PREFIX, JAVA_HOME, NODE_HOME, ZOSMF_HOST, ZOSMF_PORT, ZOSMF_APP_ID) + await page.waitForTimeout(30000); + planningPage.clickContinueToInstallation() + await page.waitForTimeout(5000); + apfAuthPage.movetoInstallationPage() + await page.waitForTimeout(5000); + }) + + test.afterEach(async () => { + await electronApp.close() + + }) + test('Test Resume Progress', async ({ page }) => { + await page.waitForTimeout(8000); + apfAuthPage.fillApfDetails(DATASET_PREFIX, AUTH_LOAD_LIB, AUTH_PLUGIN_LIB) + await page.waitForTimeout(5000); + apfAuthPage.click_saveAndClose() + await page.waitForTimeout(8000); + connectionPage.click_resumeProgress() + await page.waitForTimeout(8000); + const title = await apfAuthPage.getApfAuthPageTitle(); + expect(title).toBe(APF_AUTH_TITLE); + const datatsetPrefixValue = await apfAuthPage.get_datasetPrefix_value(); + const AuthLoadLib_Value = await apfAuthPage.get_authLoadLib_value(); + const AuthPluginLib_Value = await apfAuthPage.get_authPluginLib_value(); + expect(datatsetPrefixValue).toBe(DATASET_PREFIX); + expect(AuthLoadLib_Value).toBe(AUTH_LOAD_LIB); + expect(AuthPluginLib_Value).toBe(AUTH_PLUGIN_LIB); + }) + + test('Verify title', async ({ page }) => { + await page.waitForTimeout(5000); + apfAuthPage.fillApfDetails(DATASET_PREFIX, AUTH_LOAD_LIB, AUTH_PLUGIN_LIB) + await page.waitForTimeout(5000); + apfAuthPage.movetoApfAuthPage() + await page.waitForTimeout(5000); + expect(apfAuthPage.datasetPrefix).toBeTruthy() + expect(apfAuthPage.authLoadLib).toBeTruthy() + expect(apfAuthPage.authpluginLib).toBeTruthy() + expect(apfAuthPage.run_zwe_init_apfauth).toBeTruthy() + expect(apfAuthPage.view_yaml).toBeTruthy() + expect(apfAuthPage.save_and_close).toBeTruthy() + expect(apfAuthPage.previous_step).toBeTruthy() + expect(apfAuthPage.skip_apf_auth).toBeTruthy() + expect(apfAuthPage.continue_security_setup).toBeTruthy() + + }) + + test('test apfAuth with empty data', async ({ page }) => { + await page.waitForTimeout(5000); + apfAuthPage.fillApfDetails('', '', '') + await page.waitForTimeout(5000); + apfAuthPage.movetoApfAuthPage() + await page.waitForTimeout(5000); + apfAuthPage.initializeApfauth() + await page.waitForTimeout(5000); + const isWriteConfig_check_visible = await apfAuthPage.isWriteConfigGreenCheckVisible(); + expect(isWriteConfig_check_visible).toBe(false); + const isUploadConfig_check_visible = await apfAuthPage.isUploadConfigGreenCheckVisible(); + expect(isUploadConfig_check_visible).toBe(false); + const isInitApf_check_visible = await apfAuthPage.isInitApfGreenCheckVisible(); + expect(isInitApf_check_visible).toBe(false); + }) + + test('test apfAuth with valid data', async ({ page }) => { + await page.waitForTimeout(5000); + apfAuthPage.fillApfDetails(DATASET_PREFIX, AUTH_LOAD_LIB, AUTH_PLUGIN_LIB) + await page.waitForTimeout(5000); + apfAuthPage.movetoApfAuthPage() + await page.waitForTimeout(5000); + apfAuthPage.initializeApfauth() + await page.waitForTimeout(5000); + const isWriteConfig_check_visible = await apfAuthPage.isWriteConfigGreenCheckVisible(); + expect(isWriteConfig_check_visible).toBe(true); + const isUploadConfig_check_visible = await apfAuthPage.isUploadConfigGreenCheckVisible(); + expect(isUploadConfig_check_visible).toBe(true); + const isInitApf_check_visible = await apfAuthPage.isInitApfGreenCheckVisible(); + expect(isInitApf_check_visible).toBe(true); + }) + + test('click Previous step', async ({ page }) => { + await page.waitForTimeout(5000); + apfAuthPage.movetoApfAuthPage() + const title = await apfAuthPage.returnTitleOfPrevPage(); + expect(title).toBe(NETWORKING_TITLE); + }) + + test('test skip apfAuth button is enable', async ({ page }) => { + apfAuthPage.movetoApfAuthPage() + const isSkipApfAuthEnable = await apfAuthPage.is_skipApfAuthButtonEnable(); + expect(isSkipApfAuthEnable).toBe(true); + await page.waitForTimeout(2000); + }) + + test('test previous button is enabled', async ({ page }) => { + apfAuthPage.movetoApfAuthPage() + const is_prevButtonEnable = await apfAuthPage.isPreviousButtonEnable(); + expect(is_prevButtonEnable).toBe(true); + await page.waitForTimeout(2000); + }) + + test('test continue button is disable', async ({ page }) => { + apfAuthPage.movetoApfAuthPage() + const is_ContinueButtonDisable = await apfAuthPage.isContinueButtonDisable(); + expect(is_ContinueButtonDisable).toBe(true); + await page.waitForTimeout(2000); + }) + + test('click view yaml button', async ({ page }) => { + apfAuthPage.movetoApfAuthPage() + await page.waitForTimeout(5000); + apfAuthPage.viewYaml() + await page.waitForTimeout(5000); + expect(apfAuthPage.editor_title_element).toBeTruthy(); + apfAuthPage.closeButton() + await page.waitForTimeout(2000); + }) + + test('test click skip APFAuth button', async ({ page }) => { + await apfAuthPage.movetoApfAuthPage() + const security_title = await apfAuthPage.click_skipApfAuth(); + expect(security_title).toBe(SECURITY_TITLE); + + }) + + test('Test view and submit button', async ({ page }) => { + apfAuthPage.movetoApfAuthPage() + await page.waitForTimeout(5000); + apfAuthPage.click_viewAndSubmitJob() + await page.waitForTimeout(5000); + expect(apfAuthPage.editor_title_element).toBeTruthy() + apfAuthPage.closeButton() + await page.waitForTimeout(2000); + }) + + test('Test view job', async ({ page }) => { + apfAuthPage.movetoApfAuthPage() + await page.waitForTimeout(5000); + apfAuthPage.click_previewJob() + await page.waitForTimeout(5000); + expect(apfAuthPage.editor_title_element).toBeTruthy() + apfAuthPage.closeButton() + await page.waitForTimeout(5000); + }) + + test('Test save and close and Resume Progress', async ({ page }) => { + await page.waitForTimeout(5000); + apfAuthPage.fillApfDetails(DATASET_PREFIX, AUTH_LOAD_LIB, AUTH_PLUGIN_LIB) + await page.waitForTimeout(5000); + apfAuthPage.movetoApfAuthPage() + await page.waitForTimeout(5000); + apfAuthPage.click_saveAndClose() + await page.waitForTimeout(3000); + titlePage.clickOnResumeProgress(); + await page.waitForTimeout(15000); + const title = await securityPage.returnTitleOfSecurityPage(); + expect(title).toBe(SECURITY_TITLE); + const datatsetPrefixValue = await apfAuthPage.get_datasetPrefix_value(); + const authPluginLibValue = await apfAuthPage.get_authPluginLib_value(); + const authLoadLibValue = await apfAuthPage.get_authLoadLib_value(); + expect(datatsetPrefixValue).toBe(DATASET_PREFIX); + expect(authLoadLibValue).toBe(AUTH_LOAD_LIB); + expect(authPluginLibValue).toBe(AUTH_PLUGIN_LIB); + }) }) \ No newline at end of file diff --git a/playwright_test/Tests/Connection.spec.ts b/playwright_test/Tests/Connection.spec.ts index 16284e19..78fc525d 100644 --- a/playwright_test/Tests/Connection.spec.ts +++ b/playwright_test/Tests/Connection.spec.ts @@ -1,13 +1,11 @@ import { test, ElectronApplication, expect, _electron as electron } from '@playwright/test'; import ConnectionPage from '../Pages/connection.page'; import TitlePage from '../Pages/title.page'; -import path from 'path'; -import { spawn } from 'child_process'; import { prepareEnvironment } from '../prepare.js'; let electronApp: ElectronApplication const SSH_HOST = process.env.SSH_HOST; -const SSH_PASSWD = process.env.SSH_PASSWD; +const SSH_PASSWD = process.env.SSH_PASSWD; const SSH_PORT = process.env.SSH_PORT; const SSH_USER = process.env.SSH_USER; const CONNECTION_PAGE_TITLE = 'Connection' @@ -28,7 +26,7 @@ test.describe('ConnectionTab', () => { test.beforeEach(async ({ page }) => { test.setTimeout(900000); electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) - page= await electronApp.firstWindow() + page = await electronApp.firstWindow() connectionPage = new ConnectionPage(page); titlePage = new TitlePage(page); }); @@ -39,10 +37,8 @@ test.describe('ConnectionTab', () => { test('Test Save and close and Resume Progress', async ({ page }) => { titlePage.navigateToConnectionTab() - connectionPage.fillConnectionDetails(SSH_HOST,SSH_PORT,SSH_USER,SSH_PASSWD) + connectionPage.performLogin(SSH_HOST, SSH_PORT, SSH_USER, SSH_PASSWD) await page.waitForTimeout(5000); - connectionPage.SubmitValidateCredential() - await page.waitForTimeout(2000); connectionPage.click_saveAndClose() await page.waitForTimeout(3000); titlePage.clickOnResumeProgress(); @@ -59,10 +55,8 @@ test.describe('ConnectionTab', () => { test('test invalid credentials', async ({ page }) => { titlePage.navigateToConnectionTab() - connectionPage.fillConnectionDetails(SSH_HOST,SSH_PORT,SSH_USER,SSH_PASSWD) + connectionPage.performLogin(SSH_HOST, SSH_PORT, SSH_USER, SSH_PASSWD) await page.waitForTimeout(5000); - connectionPage.SubmitValidateCredential() - await page.waitForTimeout(2000); const isGreenIconHidden = await connectionPage.isGreenCheckIconVisible(); expect(isGreenIconHidden).toBe(true); const isContinueDisable = await connectionPage.isContinueButtonVisible(); @@ -71,21 +65,19 @@ test.describe('ConnectionTab', () => { test('test valid credentials', async ({ page }) => { titlePage.navigateToConnectionTab() - connectionPage.fillConnectionDetails(SSH_HOST,SSH_PORT,SSH_USER,SSH_PASSWD) + connectionPage.performLogin(SSH_HOST, SSH_PORT, SSH_USER, SSH_PASSWD) await page.waitForTimeout(5000); - connectionPage.SubmitValidateCredential() - await page.waitForTimeout(8000); const isGreenIconHidden = await connectionPage.isGreenCheckIconVisible(); expect(isGreenIconHidden).toBe(false); const isContinueDisable = await connectionPage.isContinueButtonVisible(); expect(isContinueDisable).toBe(false); - }) + }) test('test required fields', async ({ page }) => { - await expect(connectionPage.userName).toBeTruthy() - await expect(connectionPage.password).toBeTruthy() - await expect(connectionPage.port).toBeTruthy() - await expect(connectionPage.host).toBeTruthy() + expect(connectionPage.userName).toBeTruthy() + expect(connectionPage.password).toBeTruthy() + expect(connectionPage.port).toBeTruthy() + expect(connectionPage.host).toBeTruthy() await page.waitForTimeout(2000); }) diff --git a/playwright_test/Tests/Installation.spec.ts b/playwright_test/Tests/Installation.spec.ts index 38d84ee5..83e94747 100644 --- a/playwright_test/Tests/Installation.spec.ts +++ b/playwright_test/Tests/Installation.spec.ts @@ -11,20 +11,20 @@ const NETWORKING_PAGE_TITLE = 'Networking' const INSTALLATION_TYPE_TITLE = 'Installation Type'; const RUNTIME_DIR = process.env.ZOWE_ROOT_DIR; const SSH_HOST = process.env.SSH_HOST; -const SSH_PASSWD = process.env.SSH_PASSWD; +const SSH_PASSWD = process.env.SSH_PASSWD; const SSH_PORT = process.env.SSH_PORT; const SSH_USER = process.env.SSH_USER; -const ZOWE_EXTENSION_DIR= process.env.ZOWE_EXTENSION_DIR; -const ZOWE_LOG_DIR=process.env.ZOWE_LOG_DIR; -const ZOWE_WORKSPACE_DIR=process.env.ZOWE_WORKSPACE_DIR; -const JOB_NAME= process.env.JOB_NAME; -const JOB_PREFIX=process.env.JOB_PREFIX; -const JAVA_HOME=process.env.JAVA_HOME; -const NODE_HOME=process.env.NODE_HOME; -const ZOSMF_HOST=process.env.ZOSMF_HOST; -const ZOSMF_PORT=process.env.ZOSMF_PORT; -const ZOSMF_APP_ID=process.env.ZOSMF_APP_ID; -const DATASET_PREFIX= process.env.DATASET_PREFIX; +const ZOWE_EXTENSION_DIR = process.env.ZOWE_EXTENSION_DIR; +const ZOWE_LOG_DIR = process.env.ZOWE_LOG_DIR; +const ZOWE_WORKSPACE_DIR = process.env.ZOWE_WORKSPACE_DIR; +const JOB_NAME = process.env.JOB_NAME; +const JOB_PREFIX = process.env.JOB_PREFIX; +const JAVA_HOME = process.env.JAVA_HOME; +const NODE_HOME = process.env.NODE_HOME; +const ZOSMF_HOST = process.env.ZOSMF_HOST; +const ZOSMF_PORT = process.env.ZOSMF_PORT; +const ZOSMF_APP_ID = process.env.ZOSMF_APP_ID; +const DATASET_PREFIX = process.env.DATASET_PREFIX; const PROC_LIB = process.env.PROC_LIB; const PARM_LIB = process.env.PARM_LIB; const ZIS = process.env.SECURITY_STC_ZIS; @@ -32,21 +32,20 @@ const JCL_LIB = process.env.JCL_LIB; const LOAD_LIB = process.env.LOAD_LIB; const AUTH_LOAD_LIB = process.env.AUTH_LOAD_LIB; const AUTH_PLUGIN_LIB = process.env.AUTH_PLUGIN_LIB; -const UPLOAD_PAX_PATH= process.env.ZOWE_ROOT_DIR +const UPLOAD_PAX_PATH = process.env.ZOWE_ROOT_DIR test.describe('InstallationTab', () => { let connectionPage: ConnectionPage; - let titlePage : TitlePage; - let installationTypePage : InstallationTypePage; - let planningPage : PlanningPage; - let installationPage : InstallationPage; - let networkingPage : NetworkingPage - + let titlePage: TitlePage; + let installationTypePage: InstallationTypePage; + let planningPage: PlanningPage; + let installationPage: InstallationPage; + let networkingPage: NetworkingPage test.beforeEach(async ({ page }) => { test.setTimeout(900000); electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) - page= await electronApp.firstWindow() + page = await electronApp.firstWindow() connectionPage = new ConnectionPage(page); titlePage = new TitlePage(page); planningPage = new PlanningPage(page); @@ -54,16 +53,13 @@ test.describe('InstallationTab', () => { installationPage = new InstallationPage(page); networkingPage = new NetworkingPage(page); titlePage.navigateToConnectionTab() - connectionPage.fillConnectionDetails(SSH_HOST,SSH_PORT,SSH_USER,SSH_PASSWD) - connectionPage.SubmitValidateCredential() + connectionPage.performLogin(SSH_HOST, SSH_PORT, SSH_USER, SSH_PASSWD) await page.waitForTimeout(5000); connectionPage.clickContinueButton() await page.waitForTimeout(2000); - planningPage.clickSaveValidate() - await page.waitForTimeout(20000); - planningPage.fillPlanningPageWithRequiredFields(RUNTIME_DIR, ZOWE_WORKSPACE_DIR,ZOWE_EXTENSION_DIR,ZOWE_LOG_DIR,'1',JOB_NAME,JOB_PREFIX,JAVA_HOME,NODE_HOME,ZOSMF_HOST,ZOSMF_PORT,ZOSMF_APP_ID) + planningPage.insertValidateJobStatement() await page.waitForTimeout(20000); - planningPage.clickValidateLocations() + planningPage.validatePlanningStageLocations(RUNTIME_DIR, ZOWE_WORKSPACE_DIR, ZOWE_EXTENSION_DIR, ZOWE_LOG_DIR, '1', JOB_NAME, JOB_PREFIX, JAVA_HOME, NODE_HOME, ZOSMF_HOST, ZOSMF_PORT, ZOSMF_APP_ID) await page.waitForTimeout(20000); planningPage.clickContinueToInstallation() await page.waitForTimeout(5000); @@ -96,7 +92,7 @@ test.describe('InstallationTab', () => { expect(installationPage.continueToNetworkSetup).toBeTruthy() const is_Continue_Button_disable = await installationPage.isContinueToNetworkSetupDisabled(); expect(is_Continue_Button_disable).toBe(true); - }) + }) test('Test Installation with Valid Data with Download Pax', async ({ page }) => { await page.waitForTimeout(5000); @@ -118,7 +114,7 @@ test.describe('InstallationTab', () => { installationPage.clickContinueToNetworkSetup(); await page.waitForTimeout(2000); const networkSetup_title = await networkingPage.returnTitleOfNetworkingPage() - expect (networkSetup_title).toBe(NETWORKING_PAGE_TITLE); + expect(networkSetup_title).toBe(NETWORKING_PAGE_TITLE); }) test('Test Installation with Valid Data with Upload Pax', async ({ page }) => { @@ -141,7 +137,7 @@ test.describe('InstallationTab', () => { installationPage.clickContinueToNetworkSetup(); await page.waitForTimeout(2000); const networkSetup_title = await networkingPage.returnTitleOfNetworkingPage() - expect (networkSetup_title).toBe(NETWORKING_PAGE_TITLE); + expect(networkSetup_title).toBe(NETWORKING_PAGE_TITLE); }) test('Test Installation with Valid Data with SMPE', async ({ page }) => { @@ -164,7 +160,7 @@ test.describe('InstallationTab', () => { installationPage.clickContinueToNetworkSetup(); await page.waitForTimeout(2000); const networkSetup_title = await networkingPage.returnTitleOfNetworkingPage() - expect (networkSetup_title).toBe(NETWORKING_PAGE_TITLE); + expect(networkSetup_title).toBe(NETWORKING_PAGE_TITLE); }) test('Test Installation with the Invalid Data', async ({ page }) => { @@ -246,7 +242,7 @@ test.describe('InstallationTab', () => { await page.waitForTimeout(2000); }) - test('Test Save and Close and Resume Progress', async ({page}) => { + test('Test Save and Close and Resume Progress', async ({ page }) => { await page.waitForTimeout(5000); installationTypePage.downloadZowePaxAndNavigateToInstallationPage() installationTypePage.clickContinueToInstallation() @@ -270,5 +266,5 @@ test.describe('InstallationTab', () => { expect(procLib_value).toBe(PROC_LIB); expect(authLoadLib_value).toBe(AUTH_LOAD_LIB); expect(authPluginLib_value).toBe(AUTH_PLUGIN_LIB); - }) + }) }) \ No newline at end of file diff --git a/playwright_test/Tests/InstallationType.spec.ts b/playwright_test/Tests/InstallationType.spec.ts index 76cc395f..df39e0c1 100644 --- a/playwright_test/Tests/InstallationType.spec.ts +++ b/playwright_test/Tests/InstallationType.spec.ts @@ -10,48 +10,44 @@ const PLANNING_TITLE = 'Before you start'; const INSTALLATION_PAGE_TITLE = 'Installation'; const RUNTIME_DIR = process.env.ZOWE_ROOT_DIR; const SSH_HOST = process.env.SSH_HOST; -const SSH_PASSWD = process.env.SSH_PASSWD; +const SSH_PASSWD = process.env.SSH_PASSWD; const SSH_PORT = process.env.SSH_PORT; const SSH_USER = process.env.SSH_USER; -const ZOWE_EXTENSION_DIR= process.env.ZOWE_EXTENSION_DIR; -const ZOWE_LOG_DIR=process.env.ZOWE_LOG_DIR; -const ZOWE_WORKSPACE_DIR=process.env.ZOWE_WORKSPACE_DIR; -const JOB_NAME= process.env.JOB_NAME; -const JOB_PREFIX=process.env.JOB_PREFIX; -const JAVA_HOME=process.env.JAVA_HOME; -const NODE_HOME=process.env.NODE_HOME; -const ZOSMF_HOST=process.env.ZOSMF_HOST; -const ZOSMF_PORT=process.env.ZOSMF_PORT; -const ZOSMF_APP_ID=process.env.ZOSMF_APP_ID; -const UPLOAD_PAX_PATH= process.env.ZOWE_ROOT_DIR +const ZOWE_EXTENSION_DIR = process.env.ZOWE_EXTENSION_DIR; +const ZOWE_LOG_DIR = process.env.ZOWE_LOG_DIR; +const ZOWE_WORKSPACE_DIR = process.env.ZOWE_WORKSPACE_DIR; +const JOB_NAME = process.env.JOB_NAME; +const JOB_PREFIX = process.env.JOB_PREFIX; +const JAVA_HOME = process.env.JAVA_HOME; +const NODE_HOME = process.env.NODE_HOME; +const ZOSMF_HOST = process.env.ZOSMF_HOST; +const ZOSMF_PORT = process.env.ZOSMF_PORT; +const ZOSMF_APP_ID = process.env.ZOSMF_APP_ID; +const UPLOAD_PAX_PATH = process.env.ZOWE_ROOT_DIR test.describe('InstallationTypeTab', () => { let connectionPage: ConnectionPage; - let titlePage : TitlePage; - let installationTypePage : InstallationTypePage; - let planningPage : PlanningPage; - let installationPage : InstallationPage; + let titlePage: TitlePage; + let installationTypePage: InstallationTypePage; + let planningPage: PlanningPage; + let installationPage: InstallationPage; test.beforeEach(async ({ page }) => { test.setTimeout(900000); electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) - page= await electronApp.firstWindow() + page = await electronApp.firstWindow() connectionPage = new ConnectionPage(page); titlePage = new TitlePage(page); planningPage = new PlanningPage(page); installationTypePage = new InstallationTypePage(page); installationPage = new InstallationPage(page); titlePage.navigateToConnectionTab() - connectionPage.fillConnectionDetails(SSH_HOST,SSH_PORT,SSH_USER,SSH_PASSWD) + connectionPage.performLogin(SSH_HOST, SSH_PORT, SSH_USER, SSH_PASSWD) await page.waitForTimeout(5000); - connectionPage.SubmitValidateCredential() - await page.waitForTimeout(2000); connectionPage.clickContinueButton() - planningPage.clickSaveValidate() - await page.waitForTimeout(20000); - planningPage.fillPlanningPageWithRequiredFields(RUNTIME_DIR, ZOWE_WORKSPACE_DIR,ZOWE_EXTENSION_DIR,ZOWE_LOG_DIR,'1',JOB_NAME,JOB_PREFIX,JAVA_HOME,NODE_HOME,ZOSMF_HOST,ZOSMF_PORT,ZOSMF_APP_ID) + planningPage.insertValidateJobStatement() await page.waitForTimeout(20000); - planningPage.clickValidateLocations() + planningPage.validatePlanningStageLocations(RUNTIME_DIR, ZOWE_WORKSPACE_DIR, ZOWE_EXTENSION_DIR, ZOWE_LOG_DIR, '1', JOB_NAME, JOB_PREFIX, JAVA_HOME, NODE_HOME, ZOSMF_HOST, ZOSMF_PORT, ZOSMF_APP_ID) await page.waitForTimeout(20000); planningPage.clickContinueToInstallation() await page.waitForTimeout(5000); @@ -147,7 +143,7 @@ test.describe('InstallationTypeTab', () => { expect(title).toBe(INSTALLATION_PAGE_TITLE); }) - test('Test Save and Close and Resume Progress', async ({page}) => { + test('Test Save and Close and Resume Progress', async ({ page }) => { await page.waitForTimeout(5000) installationTypePage.selectDownloadZowePax() installationTypePage.clickLicenseAgreement() @@ -162,5 +158,5 @@ test.describe('InstallationTypeTab', () => { expect(is_GreenCheck_Visible).toBe(true); const Is_Continue_Button_Enable_After_Save = await installationTypePage.isContinueToComponentInstallationEnabled(); expect(Is_Continue_Button_Enable_After_Save).toBe(true); - }) + }) }) \ No newline at end of file diff --git a/playwright_test/Tests/LaunchConfig.spec.ts b/playwright_test/Tests/LaunchConfig.spec.ts index 64980867..d452c51a 100644 --- a/playwright_test/Tests/LaunchConfig.spec.ts +++ b/playwright_test/Tests/LaunchConfig.spec.ts @@ -4,10 +4,6 @@ import TitlePage from '../Pages/title.page'; import ConnectionPage from '../Pages/connection.page'; import PlanningPage from '../Pages/planning.page'; import LaunchConfigPage from '../Pages/launchConfig.page'; -import { spawn } from 'child_process'; -import path from 'path'; -let page: Page; - let electronApp: ElectronApplication const CONFPAGE_TITLE = 'Configuration' @@ -15,75 +11,73 @@ const CERTIFICATE_TITLE = 'Certificates' const VALIDATION_ERROR_MSG = 'is a required property' const ZOWE_ROOT_DIR = process.env.ZOWE_ROOT_DIR; const SSH_HOST = process.env.SSH_HOST; -const SSH_PASSWD = process.env.SSH_PASSWD; +const SSH_PASSWD = process.env.SSH_PASSWD; const SSH_PORT = process.env.SSH_PORT; const SSH_USER = process.env.SSH_USER; -const ZOWE_EXTENSION_DIR= process.env.ZOWE_EXTENSION_DIR; -const ZOWE_LOG_DIR=process.env.ZOWE_LOG_DIR; -const ZOWE_WORKSPACE_DIR=process.env.ZOWE_WORKSPACE_DIR; -const JOB_NAME= process.env.JOB_NAME; -const JOB_PREFIX=process.env.JOB_PREFIX; -const JAVA_HOME=process.env.JAVA_HOME; -const NODE_HOME=process.env.NODE_HOME; -const ZOSMF_HOST=process.env.ZOSMF_HOST; -const ZOSMF_PORT=process.env.ZOSMF_PORT; -const ZOSMF_APP_ID=process.env.ZOSMF_APP_ID; +const ZOWE_EXTENSION_DIR = process.env.ZOWE_EXTENSION_DIR; +const ZOWE_LOG_DIR = process.env.ZOWE_LOG_DIR; +const ZOWE_WORKSPACE_DIR = process.env.ZOWE_WORKSPACE_DIR; +const JOB_NAME = process.env.JOB_NAME; +const JOB_PREFIX = process.env.JOB_PREFIX; +const JAVA_HOME = process.env.JAVA_HOME; +const NODE_HOME = process.env.NODE_HOME; +const ZOSMF_HOST = process.env.ZOSMF_HOST; +const ZOSMF_PORT = process.env.ZOSMF_PORT; +const ZOSMF_APP_ID = process.env.ZOSMF_APP_ID; test.beforeAll(async () => { try { await prepareEnvironment({ install: true, remove: false }); } catch (error) { console.error('Error during environment preparation:', error); - process.exit(1); + process.exit(1); } }); test.describe('launchConfigTab', () => { - let connectionPage: ConnectionPage; - let titlePage : TitlePage; - let planningPage : PlanningPage; - let launchConfigPage : LaunchConfigPage; - - test.beforeEach(async ({ page }) => { - test.setTimeout(900000); - electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) - page= await electronApp.firstWindow() - connectionPage = new ConnectionPage(page); - launchConfigPage = new LaunchConfigPage(page); - titlePage = new TitlePage(page); - planningPage = new PlanningPage(page); - titlePage.navigateToConnectionTab() - connectionPage.fillConnectionDetails(SSH_HOST,SSH_PORT,SSH_USER,SSH_PASSWD) - connectionPage.SubmitValidateCredential() - await page.waitForTimeout(5000); - connectionPage.clickContinueButton() - await page.waitForTimeout(20000); - planningPage.fillPlanningPageWithRequiredFields(ZOWE_ROOT_DIR, ZOWE_WORKSPACE_DIR,ZOWE_EXTENSION_DIR,ZOWE_LOG_DIR,'1',JOB_NAME,JOB_PREFIX,JAVA_HOME,NODE_HOME,ZOSMF_HOST,ZOSMF_PORT,ZOSMF_APP_ID) - await page.waitForTimeout(20000); - planningPage.clickValidateLocations() - await page.waitForTimeout(20000); - planningPage.clickContinueToInstallation() - await page.waitForTimeout(5000); - launchConfigPage.movetoLaunchConfigPage() - await page.waitForTimeout(5000); - }) + let connectionPage: ConnectionPage; + let titlePage: TitlePage; + let planningPage: PlanningPage; + let launchConfigPage: LaunchConfigPage; + + test.beforeEach(async ({ page }) => { + test.setTimeout(900000); + electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) + page = await electronApp.firstWindow() + connectionPage = new ConnectionPage(page); + launchConfigPage = new LaunchConfigPage(page); + titlePage = new TitlePage(page); + planningPage = new PlanningPage(page); + titlePage.navigateToConnectionTab() + connectionPage.performLogin(SSH_HOST, SSH_PORT, SSH_USER, SSH_PASSWD) + await page.waitForTimeout(5000); + connectionPage.clickContinueButton() + planningPage.insertValidateJobStatement() + await page.waitForTimeout(20000); + planningPage.validatePlanningStageLocations(ZOWE_ROOT_DIR, ZOWE_WORKSPACE_DIR, ZOWE_EXTENSION_DIR, ZOWE_LOG_DIR, '1', JOB_NAME, JOB_PREFIX, JAVA_HOME, NODE_HOME, ZOSMF_HOST, ZOSMF_PORT, ZOSMF_APP_ID) + await page.waitForTimeout(20000); + planningPage.clickContinueToInstallation() + await page.waitForTimeout(5000); + launchConfigPage.movetoLaunchConfigPage() + await page.waitForTimeout(5000); + }) - test.afterEach(async () => { - await electronApp.close() - }) + test.afterEach(async () => { + await electronApp.close() + }) test('test title of page', async ({ page }) => { - await page.waitForTimeout(5000); - const title = await launchConfigPage.returnTitleOfConfPage(); - expect(title).toBe(CONFPAGE_TITLE); - }) + await page.waitForTimeout(5000); + const title = await launchConfigPage.returnTitleOfConfPage(); + expect(title).toBe(CONFPAGE_TITLE); + }) test('test all required fields', async ({ page }) => { await page.waitForTimeout(5000); - await expect(launchConfigPage.validation).toBeTruthy() - await expect(launchConfigPage.logLevel).toBeTruthy() - await expect(launchConfigPage.componentConfig).toBeTruthy() - }) + expect(launchConfigPage.validation).toBeTruthy() + expect(launchConfigPage.logLevel).toBeTruthy() + expect(launchConfigPage.componentConfig).toBeTruthy() + }) test('test select validation level', async ({ page }) => { await page.waitForTimeout(5000); @@ -91,12 +85,12 @@ test.describe('launchConfigTab', () => { const values = ['STRICT', 'COMPONENT-COMPAT']; for (const value of values) { - await launchConfigPage.fillvalues(value); - await page.waitForTimeout(5000); + await launchConfigPage.fillvalues(value); + await page.waitForTimeout(5000); - const componentConfigValue = await launchConfigPage.get_validation_value(); - await page.waitForTimeout(5000); - expect(componentConfigValue).toBe(value); + const componentConfigValue = await launchConfigPage.get_validation_value(); + await page.waitForTimeout(5000); + expect(componentConfigValue).toBe(value); } }) @@ -105,10 +99,10 @@ test.describe('launchConfigTab', () => { await page.waitForTimeout(5000); const values = ['info', 'debug', 'trace']; for (const value of values) { - await launchConfigPage.fillvalues_logLevel(value); - await page.waitForTimeout(5000); - const componentConfigValue = await launchConfigPage.get_logLevel_value(); - expect(componentConfigValue).toBe(value); + await launchConfigPage.fillvalues_logLevel(value); + await page.waitForTimeout(5000); + const componentConfigValue = await launchConfigPage.get_logLevel_value(); + expect(componentConfigValue).toBe(value); } }) @@ -116,40 +110,40 @@ test.describe('launchConfigTab', () => { await page.waitForTimeout(5000); const values = ['warn', 'exit']; for (const value of values) { - await launchConfigPage.fillvaluescomponentConfig(value); - await page.waitForTimeout(5000); - const componentConfigValue = await launchConfigPage.get_componentConfig_value(); - expect(componentConfigValue).toBe(value); + await launchConfigPage.fillvaluescomponentConfig(value); + await page.waitForTimeout(5000); + const componentConfigValue = await launchConfigPage.get_componentConfig_value(); + expect(componentConfigValue).toBe(value); } }) + test('Test view yaml button', async ({ page }) => { await page.waitForTimeout(7000); launchConfigPage.viewYaml() await page.waitForTimeout(5000); - await expect(launchConfigPage.editor_title_element).toBeTruthy(); + expect(launchConfigPage.editor_title_element).toBeTruthy(); await page.waitForTimeout(5000); launchConfigPage.closeButton() await page.waitForTimeout(2000); - }) + }) test('Test view and submit button', async ({ page }) => { - await page.waitForTimeout(5000); - launchConfigPage.click_viewAndSubmitJob() - await page.waitForTimeout(5000); - await expect(launchConfigPage.editor_title_element).toBeTruthy() - launchConfigPage.closeButton() - await page.waitForTimeout(2000); - }) - + await page.waitForTimeout(5000); + launchConfigPage.click_viewAndSubmitJob() + await page.waitForTimeout(5000); + expect(launchConfigPage.editor_title_element).toBeTruthy() + launchConfigPage.closeButton() + await page.waitForTimeout(2000); + }) test('Test view job', async ({ page }) => { - await page.waitForTimeout(5000); - launchConfigPage.click_previewJob() - await page.waitForTimeout(5000); - await expect(launchConfigPage.editor_title_element).toBeTruthy() - launchConfigPage.closeButton() - await page.waitForTimeout(5000); - }) + await page.waitForTimeout(5000); + launchConfigPage.click_previewJob() + await page.waitForTimeout(5000); + expect(launchConfigPage.editor_title_element).toBeTruthy() + launchConfigPage.closeButton() + await page.waitForTimeout(5000); + }) test('Test save and close and Resume Progress', async ({ page }) => { await page.waitForTimeout(5000); @@ -169,32 +163,33 @@ test.describe('launchConfigTab', () => { expect(Validation_Value).toBe('STRICT'); expect(LogLevel_Value).toBe('info'); expect(ComponentConfig_Value).toBe('warn'); - }) + }) test('click Previous step button', async ({ page }) => { - await page.waitForTimeout(5000); - const title = await launchConfigPage.returnTitleOfPrevPage(); - expect(title).toBe(CERTIFICATE_TITLE); - }) + await page.waitForTimeout(5000); + const title = await launchConfigPage.returnTitleOfPrevPage(); + expect(title).toBe(CERTIFICATE_TITLE); + }) + test('Test previous button is enabled', async ({ page }) => { - const is_prevButtonEnable = await launchConfigPage.isPreviousButtonEnable(); - expect(is_prevButtonEnable).toBe(true); - await page.waitForTimeout(2000); - }) + const is_prevButtonEnable = await launchConfigPage.isPreviousButtonEnable(); + expect(is_prevButtonEnable).toBe(true); + await page.waitForTimeout(2000); + }) test('Test continue to review button is disable', async ({ page }) => { - await page.waitForTimeout(2000); - const is_ContinueButtonDisable = await launchConfigPage.isContinueButtonDisable(); - expect(is_ContinueButtonDisable).toBe(true); - await page.waitForTimeout(2000); - }) + await page.waitForTimeout(2000); + const is_ContinueButtonDisable = await launchConfigPage.isContinueButtonDisable(); + expect(is_ContinueButtonDisable).toBe(true); + await page.waitForTimeout(2000); + }) test('Test Skip launch config button is enable', async ({ page }) => { - await page.waitForTimeout(2000); - const isLaunchConfigEnable = await launchConfigPage.is_skipLaunchConfigButtonEnable(); - expect(isLaunchConfigEnable).toBe(true); - await page.waitForTimeout(2000); - }) + await page.waitForTimeout(2000); + const isLaunchConfigEnable = await launchConfigPage.is_skipLaunchConfigButtonEnable(); + expect(isLaunchConfigEnable).toBe(true); + await page.waitForTimeout(2000); + }) test('Test yaml should be updated', async ({ page }) => { await page.waitForTimeout(5000); @@ -206,20 +201,20 @@ test.describe('launchConfigTab', () => { await page.waitForTimeout(15000); await launchConfigPage.viewYaml(); await page.waitForTimeout(10000); - await expect(launchConfigPage.editor_title_element).toBeTruthy(); + expect(launchConfigPage.editor_title_element).toBeTruthy(); await page.waitForTimeout(5000); const yaml = await launchConfigPage.read_yaml(); await page.waitForTimeout(5000); expect(yaml).toContain('info'); expect(yaml).toContain('STRICT'); expect(yaml).toContain('warn'); - }) + }) test('Test keep mandatory field empty', async ({ page }) => { await page.waitForTimeout(5000); await launchConfigPage.fillvalues(''); await page.waitForTimeout(5000); const Errormsg = await launchConfigPage.get_validation_error_msg(); - expect(Errormsg).expect(VALIDATION_ERROR_MSG); - }) + expect(Errormsg).toBe(VALIDATION_ERROR_MSG); + }) }); diff --git a/playwright_test/Tests/Networking.spec.ts b/playwright_test/Tests/Networking.spec.ts index ca101094..53897cf3 100644 --- a/playwright_test/Tests/Networking.spec.ts +++ b/playwright_test/Tests/Networking.spec.ts @@ -1,116 +1,107 @@ import { test, ElectronApplication, expect, _electron as electron } from '@playwright/test'; import SecurityPage from '../Pages/security.page'; -import ApfAuthPage from '../Pages/ApfAuth.page'; import { prepareEnvironment } from '../prepare.js'; import TitlePage from '../Pages/title.page'; import ConnectionPage from '../Pages/connection.page'; import PlanningPage from '../Pages/planning.page'; import NetworkingPage from '../Pages/networking.page'; -import path from 'path'; - -let page: Page; let electronApp: ElectronApplication const NETWORKING_TITLE = 'Networking'; -const APFAUTH_TITLE = 'APF Authorize Load Libraries'; const INSTALLATION_TITLE = 'Installation'; const DOMAIN_NAME = process.env.DOMAIN_NAME; const EXTERNAL_PORT = process.env.EXTERNAL_PORT; const ZOWE_ROOT_DIR = process.env.ZOWE_ROOT_DIR; const SSH_HOST = process.env.SSH_HOST; -const SSH_PASSWD = process.env.SSH_PASSWD; +const SSH_PASSWD = process.env.SSH_PASSWD; const SSH_PORT = process.env.SSH_PORT; const SSH_USER = process.env.SSH_USER; -const ZOWE_EXTENSION_DIR= process.env.ZOWE_EXTENSION_DIR; -const ZOWE_LOG_DIR=process.env.ZOWE_LOG_DIR; -const ZOWE_WORKSPACE_DIR=process.env.ZOWE_WORKSPACE_DIR; -const JOB_NAME= process.env.JOB_NAME; -const JOB_PREFIX=process.env.JOB_PREFIX; -const JAVA_HOME=process.env.JAVA_HOME; -const NODE_HOME=process.env.NODE_HOME; -const ZOSMF_HOST=process.env.ZOSMF_HOST; -const ZOSMF_PORT=process.env.ZOSMF_PORT; -const ZOSMF_APP_ID=process.env.ZOSMF_APP_ID; +const ZOWE_EXTENSION_DIR = process.env.ZOWE_EXTENSION_DIR; +const ZOWE_LOG_DIR = process.env.ZOWE_LOG_DIR; +const ZOWE_WORKSPACE_DIR = process.env.ZOWE_WORKSPACE_DIR; +const JOB_NAME = process.env.JOB_NAME; +const JOB_PREFIX = process.env.JOB_PREFIX; +const JAVA_HOME = process.env.JAVA_HOME; +const NODE_HOME = process.env.NODE_HOME; +const ZOSMF_HOST = process.env.ZOSMF_HOST; +const ZOSMF_PORT = process.env.ZOSMF_PORT; +const ZOSMF_APP_ID = process.env.ZOSMF_APP_ID; test.beforeAll(async () => { try { await prepareEnvironment({ install: true, remove: false }); } catch (error) { console.error('Error during environment preparation:', error); - process.exit(1); + process.exit(1); } }); test.describe('networkingTab', () => { - let connectionPage: ConnectionPage; - let titlePage : TitlePage; - let securityPage : SecurityPage; - let planningPage : PlanningPage; - let networkingPage : NetworkingPage; - - test.beforeEach(async ({ page }) => { - test.setTimeout(900000); - electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) - page= await electronApp.firstWindow() - connectionPage = new ConnectionPage(page); - networkingPage = new NetworkingPage(page); - titlePage = new TitlePage(page); - planningPage = new PlanningPage(page); - titlePage.navigateToConnectionTab() - connectionPage.fillConnectionDetails(SSH_HOST,SSH_PORT,SSH_USER,SSH_PASSWD) - connectionPage.SubmitValidateCredential() - await page.waitForTimeout(5000); - connectionPage.clickContinueButton() - planningPage.clickSaveValidate() - await page.waitForTimeout(20000); - planningPage.fillPlanningPageWithRequiredFields(ZOWE_ROOT_DIR, ZOWE_WORKSPACE_DIR,ZOWE_EXTENSION_DIR,ZOWE_LOG_DIR,'1',JOB_NAME,JOB_PREFIX,JAVA_HOME,NODE_HOME,ZOSMF_HOST,ZOSMF_PORT,ZOSMF_APP_ID) - await page.waitForTimeout(20000); - planningPage.clickValidateLocations() - await page.waitForTimeout(20000); - planningPage.clickContinueToInstallation() - await page.waitForTimeout(5000); - networkingPage.movetoNetworkingPage() - await page.waitForTimeout(5000); - }) - - test.afterEach(async () => { - await electronApp.close() - }) + let connectionPage: ConnectionPage; + let titlePage: TitlePage; + let planningPage: PlanningPage; + let networkingPage: NetworkingPage; + + test.beforeEach(async ({ page }) => { + test.setTimeout(900000); + electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) + page = await electronApp.firstWindow() + connectionPage = new ConnectionPage(page); + networkingPage = new NetworkingPage(page); + titlePage = new TitlePage(page); + planningPage = new PlanningPage(page); + titlePage.navigateToConnectionTab() + connectionPage.performLogin(SSH_HOST, SSH_PORT, SSH_USER, SSH_PASSWD) + await page.waitForTimeout(5000); + connectionPage.clickContinueButton() + planningPage.insertValidateJobStatement() + await page.waitForTimeout(20000); + planningPage.validatePlanningStageLocations(ZOWE_ROOT_DIR, ZOWE_WORKSPACE_DIR, ZOWE_EXTENSION_DIR, ZOWE_LOG_DIR, '1', JOB_NAME, JOB_PREFIX, JAVA_HOME, NODE_HOME, ZOSMF_HOST, ZOSMF_PORT, ZOSMF_APP_ID) + await page.waitForTimeout(20000); + planningPage.clickContinueToInstallation() + await page.waitForTimeout(5000); + networkingPage.movetoNetworkingPage() + await page.waitForTimeout(5000); + }) + + test.afterEach(async () => { + await electronApp.close() + }) test('test title of page', async ({ page }) => { - await page.waitForTimeout(5000); - const title = await networkingPage.returnTitleOfNetworkingPage(); - expect(title).toBe(NETWORKING_TITLE); - }) + await page.waitForTimeout(5000); + const title = await networkingPage.returnTitleOfNetworkingPage(); + expect(title).toBe(NETWORKING_TITLE); + }) + test('test all required fields', async ({ page }) => { await page.waitForTimeout(5000); - await expect(networkingPage.externalDomains).toBeTruthy() - await expect(networkingPage.externalPort).toBeTruthy() - await expect(networkingPage.components).toBeTruthy() - await expect(networkingPage.metricService).toBeTruthy() - await expect(networkingPage.zss).toBeTruthy() - await expect(networkingPage.explorerUss).toBeTruthy() - await expect(networkingPage.jobsApi).toBeTruthy() - await expect(networkingPage.filesApi).toBeTruthy() - await expect(networkingPage.filesApiDebug).toBeTruthy() - await expect(networkingPage.explorerMvs).toBeTruthy() - await expect(networkingPage.cloudGateway).toBeTruthy() - await expect(networkingPage.explorerJes).toBeTruthy() - await expect(networkingPage.apiCatalog).toBeTruthy() - await expect(networkingPage.gateway).toBeTruthy() - await expect(networkingPage.appServer).toBeTruthy() - await expect(networkingPage.cachingService).toBeTruthy() - await expect(networkingPage.discovery).toBeTruthy() - - }) + expect(networkingPage.externalDomains).toBeTruthy() + expect(networkingPage.externalPort).toBeTruthy() + expect(networkingPage.components).toBeTruthy() + expect(networkingPage.metricService).toBeTruthy() + expect(networkingPage.zss).toBeTruthy() + expect(networkingPage.explorerUss).toBeTruthy() + expect(networkingPage.jobsApi).toBeTruthy() + expect(networkingPage.filesApi).toBeTruthy() + expect(networkingPage.filesApiDebug).toBeTruthy() + expect(networkingPage.explorerMvs).toBeTruthy() + expect(networkingPage.cloudGateway).toBeTruthy() + expect(networkingPage.explorerJes).toBeTruthy() + expect(networkingPage.apiCatalog).toBeTruthy() + expect(networkingPage.gateway).toBeTruthy() + expect(networkingPage.appServer).toBeTruthy() + expect(networkingPage.cachingService).toBeTruthy() + expect(networkingPage.discovery).toBeTruthy() + }) test('test external domain field', async ({ page }) => { await page.waitForTimeout(5000); - await networkingPage.fillexternal_domainvalues(DOMAIN_NAME,EXTERNAL_PORT); + await networkingPage.fillexternal_domainvalues(DOMAIN_NAME, EXTERNAL_PORT); await page.waitForTimeout(5000); const port = await networkingPage.get_externalDomainport_value(); const domainName = await networkingPage.get_externalDomainName_value(); - console.log(port,domainName) + console.log(port, domainName) expect(port).toBe(DOMAIN_NAME); expect(domainName).toBe(EXTERNAL_PORT); await page.waitForTimeout(5000); @@ -127,8 +118,9 @@ test.describe('networkingTab', () => { await page.waitForTimeout(5000); await networkingPage.add_DomainNameField(); await page.waitForTimeout(5000); - await expect(networkingPage.domainName).toBeTruthy() + expect(networkingPage.domainName).toBeTruthy() }) + test('test add special char in other port no', async ({ page }) => { await page.waitForTimeout(5000); await networkingPage.fillMetricServicePort('*^%$^&'); @@ -152,34 +144,33 @@ test.describe('networkingTab', () => { await page.waitForTimeout(7000); networkingPage.viewYaml() await page.waitForTimeout(5000); - await expect(networkingPage.editor_title_element).toBeTruthy(); + expect(networkingPage.editor_title_element).toBeTruthy(); await page.waitForTimeout(5000); networkingPage.closeButton() await page.waitForTimeout(2000); - }) + }) test('Test view and submit button', async ({ page }) => { - await page.waitForTimeout(5000); - networkingPage.click_viewAndSubmitJob() - await page.waitForTimeout(5000); - await expect(networkingPage.editor_title_element).toBeTruthy() - networkingPage.closeButton() - await page.waitForTimeout(2000); - }) - + await page.waitForTimeout(5000); + networkingPage.click_viewAndSubmitJob() + await page.waitForTimeout(5000); + expect(networkingPage.editor_title_element).toBeTruthy() + networkingPage.closeButton() + await page.waitForTimeout(2000); + }) test('Test view job', async ({ page }) => { - await page.waitForTimeout(5000); - networkingPage.click_previewJob() - await page.waitForTimeout(5000); - await expect(networkingPage.editor_title_element).toBeTruthy() - networkingPage.closeButton() - await page.waitForTimeout(5000); - }) + await page.waitForTimeout(5000); + networkingPage.click_previewJob() + await page.waitForTimeout(5000); + expect(networkingPage.editor_title_element).toBeTruthy() + networkingPage.closeButton() + await page.waitForTimeout(5000); + }) test('Test save and close', async ({ page }) => { await page.waitForTimeout(5000); - await networkingPage.fillexternal_domainvalues(DOMAIN_NAME,EXTERNAL_PORT); + await networkingPage.fillexternal_domainvalues(DOMAIN_NAME, EXTERNAL_PORT); await page.waitForTimeout(5000); networkingPage.click_saveAndClose() await page.waitForTimeout(3000); @@ -193,43 +184,45 @@ test.describe('networkingTab', () => { expect(domainName).toBe(DOMAIN_NAME); await page.waitForTimeout(5000); - }) + }) test('click Previous step button', async ({ page }) => { - await page.waitForTimeout(5000); - const title = await networkingPage.returnTitleOfPrevPage(); - expect(title).toBe(INSTALLATION_TITLE); - }) + await page.waitForTimeout(5000); + const title = await networkingPage.returnTitleOfPrevPage(); + expect(title).toBe(INSTALLATION_TITLE); + }) + test('Test previous button is enabled', async ({ page }) => { - const is_prevButtonEnable = await networkingPage.isPreviousButtonEnable(); - expect(is_prevButtonEnable).toBe(true); - await page.waitForTimeout(2000); - }) + const is_prevButtonEnable = await networkingPage.isPreviousButtonEnable(); + expect(is_prevButtonEnable).toBe(true); + await page.waitForTimeout(2000); + }) test('Test continue to APF Auth button is disable', async ({ page }) => { - await page.waitForTimeout(2000); - const is_ContinueButtonDisable = await networkingPage.isContinueButtonDisable(); - expect(is_ContinueButtonDisable).toBe(true); - await page.waitForTimeout(2000); - }) + await page.waitForTimeout(2000); + const is_ContinueButtonDisable = await networkingPage.isContinueButtonDisable(); + expect(is_ContinueButtonDisable).toBe(true); + await page.waitForTimeout(2000); + }) + test('Test Skip networking button is enable', async ({ page }) => { - await page.waitForTimeout(2000); - const isLaunchConfigEnable = await networkingPage.is_skipNetworkingButtonEnable(); - expect(isLaunchConfigEnable).toBe(true); - await page.waitForTimeout(2000); - }) + await page.waitForTimeout(2000); + const isLaunchConfigEnable = await networkingPage.is_skipNetworkingButtonEnable(); + expect(isLaunchConfigEnable).toBe(true); + await page.waitForTimeout(2000); + }) test('Test yaml should be updated', async ({ page }) => { await page.waitForTimeout(5000); - await networkingPage.fillexternal_domainvalues(DOMAIN_NAME,EXTERNAL_PORT); + await networkingPage.fillexternal_domainvalues(DOMAIN_NAME, EXTERNAL_PORT); await page.waitForTimeout(5000); await networkingPage.viewYaml(); await page.waitForTimeout(10000); - await expect(networkingPage.editor_title_element).toBeTruthy(); + expect(networkingPage.editor_title_element).toBeTruthy(); await page.waitForTimeout(5000); const yaml = await networkingPage.read_yaml(); await page.waitForTimeout(5000); expect(yaml).toContain(DOMAIN_NAME); expect(yaml).toContain(EXTERNAL_PORT); - }) + }) }); diff --git a/playwright_test/Tests/Planning.spec.ts b/playwright_test/Tests/Planning.spec.ts index 61ed9f54..780e5f4d 100644 --- a/playwright_test/Tests/Planning.spec.ts +++ b/playwright_test/Tests/Planning.spec.ts @@ -3,13 +3,12 @@ import ConnectionPage from '../Pages/connection.page'; import TitlePage from '../Pages/title.page'; import PlanningPage from '../Pages/planning.page.ts'; import InstallationTypePage from '../Pages/installationType.page.ts'; -import path from 'path'; let page: Page; let electronApp: ElectronApplication const CONNECTION_PAGE_TITLE = 'Connection'; const SSH_HOST = process.env.SSH_HOST; -const SSH_PASSWD = process.env.SSH_PASSWD; +const SSH_PASSWD = process.env.SSH_PASSWD; const SSH_PORT = process.env.SSH_PORT; const SSH_USER = process.env.SSH_USER; const PLANNING_TITLE = 'Before you start'; @@ -17,6 +16,7 @@ const INSTALLATION_TYPE_TITLE = 'Installation Type'; const JOB_STATEMENT = "//HELLOJOB JOB 'HELLO, WORLD!',CLASS=A,MSGCLASS=A\n//STEP01 EXEC PGM=IEFBR14\n//SYSPRINT DD SYSOUT=A\n//SYSIN DD DUMMY"; const INVALID_JOB_STATEMENT = "//HELLOJOB JOB 'HELLO, WORLD!',CLASS=A,MSGCLASS"; const ERROR_MESSAGE = "Failed to verify job statement"; +const ERROR_MESSAGE1 = "Error invoking remote method 'get-env-vars': Error: Failed to submit jcl, job id not found" const RUNTIME_DIR = process.env.ZOWE_ROOT_DIR; const WORKSPACE_DIR = process.env.ZOWE_WORKSPACE_DIR; const LOG_DIR = process.env.ZOWE_LOG_DIR; @@ -27,225 +27,214 @@ const JOB_PREFIX = process.env.JOB_PREFIX; const COOKIE_IDENTIFIER = '1'; const JAVA_LOCATION = process.env.JAVA_HOME; const NODEJS_LOCATION = process.env.NODE_HOME; -const ZOSMF_HOST=process.env.ZOSMF_HOST; -const ZOSMF_PORT=process.env.ZOSMF_PORT; -const ZOSMF_APP_ID=process.env.ZOSMF_APP_ID; +const ZOSMF_HOST = process.env.ZOSMF_HOST; +const ZOSMF_PORT = process.env.ZOSMF_PORT; +const ZOSMF_APP_ID = process.env.ZOSMF_APP_ID; test.describe('PlanningTab', () => { - let connectionPage: ConnectionPage; - let titlePage : TitlePage; - let planningPage: PlanningPage; - let installationTypePage: InstallationTypePage + let connectionPage: ConnectionPage; + let titlePage: TitlePage; + let planningPage: PlanningPage; + let installationTypePage: InstallationTypePage - test.beforeEach(async () => { - test.setTimeout(900000); - electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) - page= await electronApp.firstWindow() - connectionPage = new ConnectionPage(page); - titlePage = new TitlePage(page); - planningPage = new PlanningPage(page); - installationTypePage = new InstallationTypePage(page); - titlePage.navigateToConnectionTab(); - connectionPage.fillConnectionDetails(SSH_HOST,SSH_PORT,SSH_USER,SSH_PASSWD) - connectionPage.SubmitValidateCredential(); - await page.waitForTimeout(5000); - connectionPage.clickContinueButton(); - await page.waitForTimeout(3000); - - }) + test.beforeEach(async () => { + test.setTimeout(900000); + electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) + page = await electronApp.firstWindow() + connectionPage = new ConnectionPage(page); + titlePage = new TitlePage(page); + planningPage = new PlanningPage(page); + installationTypePage = new InstallationTypePage(page); + titlePage.navigateToConnectionTab() + connectionPage.performLogin(SSH_HOST, SSH_PORT, SSH_USER, SSH_PASSWD) + await page.waitForTimeout(5000); + connectionPage.clickContinueButton(); + await page.waitForTimeout(3000); + }) - test.afterEach(async () => { - await electronApp.close() - }) + test.afterEach(async () => { + await electronApp.close() + }) - test('Test all required fields on Planning Tab', async () => { - expect(planningPage.planningPageTitle).toBeTruthy(); - expect(planningPage.zoweInstallationLink).toBeTruthy(); - expect(planningPage.jobStatement).toBeTruthy(); - expect(planningPage.saveAndValidate).toBeTruthy(); - }) + test('Test all required fields on Planning Tab', async () => { + expect(planningPage.planningPageTitle).toBeTruthy(); + expect(planningPage.zoweInstallationLink).toBeTruthy(); + expect(planningPage.jobStatement).toBeTruthy(); + expect(planningPage.saveAndValidate).toBeTruthy(); + }) - test('Test Valid Job Statement and Save Validate', async () => { - planningPage.enterJobStatement(JOB_STATEMENT); - planningPage.clickSaveAndValidate(); - await page.waitForTimeout(20000); - const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); - expect(isGreen_check_visible).toBe(true); - }) + test('Test Valid Job Statement and Save Validate', async () => { + planningPage.validateJobStatement(JOB_STATEMENT); + await page.waitForTimeout(20000); + const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); + expect(isGreen_check_visible).toBe(true); + }) - test('Test Invalid Job Statement and Save Validate', async () => { - planningPage.enterJobStatement(INVALID_JOB_STATEMENT); - planningPage.clickSaveAndValidate(); - await page.waitForTimeout(20000); - const error_Message = await planningPage.getErrorMessage() - expect (error_Message).toBe(ERROR_MESSAGE); - const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); - expect(isGreen_check_visible).toBe(false); - }) + test('Test Invalid Job Statement and Save Validate', async () => { + planningPage.validateJobStatement(INVALID_JOB_STATEMENT); + await page.waitForTimeout(20000); + const error_Message = await planningPage.getErrorMessage() + expect(error_Message).toBe(ERROR_MESSAGE); + const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); + expect(isGreen_check_visible).toBe(false); + }) - test('Test Empty Job Statement and Save Validate', async () => { - planningPage.enterJobStatement(''); - planningPage.clickSaveAndValidate(); - await page.waitForTimeout(20000); - const error_Message = await planningPage.getErrorMessage() - expect (error_Message).toBe(ERROR_MESSAGE); - const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); - expect(isGreen_check_visible).toBe(false); - }) + test('Test Empty Job Statement and Save Validate', async () => { + planningPage.validateJobStatement(''); + await page.waitForTimeout(20000); + const error_Message = await planningPage.getErrorMessage() + expect(error_Message).toBe(ERROR_MESSAGE1); + const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); + expect(isGreen_check_visible).toBe(false); + }) - test('Test all required fields on Planning Tab After Job Validation', async () => { - planningPage.enterJobStatement(JOB_STATEMENT); - planningPage.clickSaveAndValidate(); - await page.waitForTimeout(20000); - expect(planningPage.runtimeDir).toBeTruthy(); - expect(planningPage.workspaceDir).toBeTruthy(); - expect(planningPage.logsDir).toBeTruthy(); - expect(planningPage.extensionsDir).toBeTruthy(); - expect(planningPage.rbacProfileIdentifier).toBeTruthy(); - expect(planningPage.jobName).toBeTruthy(); - expect(planningPage.jobPrefix).toBeTruthy(); - expect(planningPage.cookieIdentifier).toBeTruthy(); - expect(planningPage.javaLocation).toBeTruthy(); - expect(planningPage.nodeJsLocation).toBeTruthy(); - expect(planningPage.setZosmf).toBeTruthy(); - expect(planningPage.zosmfHost).toBeTruthy(); - expect(planningPage.zosmfPort).toBeTruthy(); - expect(planningPage.zosmfApplicationId).toBeTruthy(); - expect(planningPage.validateLocations).toBeTruthy(); - expect(planningPage.saveAndClose).toBeTruthy(); - expect(planningPage.previousStep).toBeTruthy(); - expect(planningPage.continueInstallationOptions).toBeTruthy(); - const is_Continue_Button_disable = await planningPage.isContinueToInstallationDisabled(); - expect(is_Continue_Button_disable).toBe(true); - }) + test('Test all required fields on Planning Tab After Job Validation', async () => { + planningPage.validateJobStatement(JOB_STATEMENT); + await page.waitForTimeout(20000); + expect(planningPage.runtimeDir).toBeTruthy(); + expect(planningPage.workspaceDir).toBeTruthy(); + expect(planningPage.logsDir).toBeTruthy(); + expect(planningPage.extensionsDir).toBeTruthy(); + expect(planningPage.rbacProfileIdentifier).toBeTruthy(); + expect(planningPage.jobName).toBeTruthy(); + expect(planningPage.jobPrefix).toBeTruthy(); + expect(planningPage.cookieIdentifier).toBeTruthy(); + expect(planningPage.javaLocation).toBeTruthy(); + expect(planningPage.nodeJsLocation).toBeTruthy(); + expect(planningPage.setZosmf).toBeTruthy(); + expect(planningPage.zosmfHost).toBeTruthy(); + expect(planningPage.zosmfPort).toBeTruthy(); + expect(planningPage.zosmfApplicationId).toBeTruthy(); + expect(planningPage.validateLocations).toBeTruthy(); + expect(planningPage.saveAndClose).toBeTruthy(); + expect(planningPage.previousStep).toBeTruthy(); + expect(planningPage.continueInstallationOptions).toBeTruthy(); + }) - test('Test Validate Locations with Valid Data', async () => { - planningPage.enterJobStatement(JOB_STATEMENT); - planningPage.clickSaveAndValidate(); - await page.waitForTimeout(20000); - planningPage.enterRuntimeDir(RUNTIME_DIR); - await page.waitForTimeout(2000); - planningPage.enterWorkspaceDir(WORKSPACE_DIR); - await page.waitForTimeout(2000); - planningPage.enterLogsDir(LOG_DIR); - await page.waitForTimeout(2000); - planningPage.enterExtensionsDir(EXTENSIONS_DIR); - await page.waitForTimeout(2000); - planningPage.enterRbacProfileIdentifier(RBAC_IDENTIFIER); - await page.waitForTimeout(2000); - planningPage.enterJobName(JOB_NAME); - await page.waitForTimeout(2000); - planningPage.enterJobPrefix(JOB_PREFIX); - await page.waitForTimeout(2000); - planningPage.enterCookieIdentifier(COOKIE_IDENTIFIER); - await page.waitForTimeout(2000); - planningPage.enterJavaLocation(JAVA_LOCATION); - await page.waitForTimeout(2000); - planningPage.enterNodeJsLocation(NODEJS_LOCATION); - await page.waitForTimeout(2000); - planningPage.checkSetZosmfAttribute(); - await page.waitForTimeout(2000); - planningPage.enterZosmfHost(ZOSMF_HOST); - await page.waitForTimeout(2000); - planningPage.enterZosmfPort(ZOSMF_PORT); - await page.waitForTimeout(2000); - planningPage.enterZosmfApplicationId(ZOSMF_APPID); - await page.waitForTimeout(2000); - planningPage.clickValidateLocations(); - await page.waitForTimeout(20000); - const is_GreenCheck_Visible = await planningPage.isValidateLocationsGreenCheckVisible(); - expect(is_GreenCheck_Visible).toBe(true); - const is_Continue_Button_enable = await planningPage.isContinueToInstallationEnabled(); - expect(is_Continue_Button_enable).toBe(true); - planningPage.clickContinueToInstallation(); - await page.waitForTimeout(2000); - const installationType_title = await installationTypePage.getInstallationTypePageTitle() - expect (installationType_title).toBe(INSTALLATION_TYPE_TITLE); - }) + test('Test Validate Locations with Valid Data', async () => { + planningPage.validateJobStatement(JOB_STATEMENT); + await page.waitForTimeout(20000); + planningPage.enterRuntimeDir(RUNTIME_DIR); + await page.waitForTimeout(1000); + planningPage.enterWorkspaceDir(WORKSPACE_DIR); + await page.waitForTimeout(1000); + planningPage.enterLogsDir(LOG_DIR); + await page.waitForTimeout(1000); + planningPage.enterExtensionsDir(EXTENSIONS_DIR); + await page.waitForTimeout(1000); + planningPage.enterRbacProfileIdentifier(RBAC_IDENTIFIER); + await page.waitForTimeout(1000); + planningPage.enterJobName(JOB_NAME); + await page.waitForTimeout(1000); + planningPage.enterJobPrefix(JOB_PREFIX); + await page.waitForTimeout(1000); + planningPage.enterCookieIdentifier(COOKIE_IDENTIFIER); + await page.waitForTimeout(1000); + planningPage.enterJavaLocation(JAVA_LOCATION); + await page.waitForTimeout(1000); + planningPage.enterNodeJsLocation(NODEJS_LOCATION); + await page.waitForTimeout(1000); + planningPage.checkSetZosmfAttribute(); + await page.waitForTimeout(1000); + planningPage.enterZosmfHost(ZOSMF_HOST); + await page.waitForTimeout(1000); + planningPage.enterZosmfPort(ZOSMF_PORT); + await page.waitForTimeout(1000); + planningPage.enterZosmfApplicationId(ZOSMF_APP_ID); + await page.waitForTimeout(1000); + planningPage.clickValidateLocations(); + await page.waitForTimeout(20000); + const is_GreenCheck_Visible = await planningPage.isValidateLocationsGreenCheckVisible(); + expect(is_GreenCheck_Visible).toBe(true); + const is_Continue_Button_enable = await planningPage.isContinueToInstallationEnabled(); + expect(is_Continue_Button_enable).toBe(true); + planningPage.clickContinueToInstallation(); + await page.waitForTimeout(1000); + const installationType_title = await installationTypePage.getInstallationTypePageTitle() + expect(installationType_title).toBe(INSTALLATION_TYPE_TITLE); + }) - test('Test Validate Locations with Invalid Data', async () => { - await page.waitForTimeout(2000); - planningPage.enterJobStatement(JOB_STATEMENT); - planningPage.clickSaveAndValidate(); - await page.waitForTimeout(20000); - planningPage.enterRuntimeDir('Test/DIR'); - await page.waitForTimeout(2000); - planningPage.enterWorkspaceDir('Workspace Dir'); - await page.waitForTimeout(2000); - planningPage.enterLogsDir(LOG_DIR); - await page.waitForTimeout(2000); - planningPage.enterExtensionsDir(EXTENSIONS_DIR); - await page.waitForTimeout(2000); - planningPage.enterRbacProfileIdentifier(22); - await page.waitForTimeout(2000); - planningPage.enterJobName(JOB_NAME); - await page.waitForTimeout(2000); - planningPage.enterJobPrefix(JOB_PREFIX); - await page.waitForTimeout(2000); - planningPage.enterCookieIdentifier(99999); - await page.waitForTimeout(2000); - planningPage.enterJavaLocation('/'); - await page.waitForTimeout(2000); - planningPage.enterNodeJsLocation(NODEJS_LOCATION); - await page.waitForTimeout(2000); - planningPage.checkSetZosmfAttribute(); - await page.waitForTimeout(2000); - planningPage.enterZosmfHost(ZOSMF_HOST); - await page.waitForTimeout(2000); - planningPage.enterZosmfPort(987776); - await page.waitForTimeout(2000); - planningPage.enterZosmfApplicationId('ABCDDDETT'); - await page.waitForTimeout(2000); - planningPage.clickValidateLocations(); - await page.waitForTimeout(20000); - const is_GreenCheck_Visible = await planningPage.isValidateLocationsGreenCheckVisible(); - expect(is_GreenCheck_Visible).toBe(false); - const is_Continue_Button_enable = await planningPage.isContinueToInstallationEnabled(); - expect(is_Continue_Button_enable).toBe(false); - }) + test('Test Validate Locations with Invalid Data', async () => { + await page.waitForTimeout(1000); + planningPage.validateJobStatement(JOB_STATEMENT); + await page.waitForTimeout(20000); + planningPage.enterRuntimeDir('Test/DIR'); + await page.waitForTimeout(1000); + planningPage.enterWorkspaceDir('Workspace Dir'); + await page.waitForTimeout(1000); + planningPage.enterLogsDir(LOG_DIR); + await page.waitForTimeout(1000); + planningPage.enterExtensionsDir(EXTENSIONS_DIR); + await page.waitForTimeout(1000); + planningPage.enterRbacProfileIdentifier('22'); + await page.waitForTimeout(1000); + planningPage.enterJobName(JOB_NAME); + await page.waitForTimeout(1000); + planningPage.enterJobPrefix(JOB_PREFIX); + await page.waitForTimeout(1000); + planningPage.enterCookieIdentifier('99999'); + await page.waitForTimeout(1000); + planningPage.enterJavaLocation('/'); + await page.waitForTimeout(1000); + planningPage.enterNodeJsLocation(NODEJS_LOCATION); + await page.waitForTimeout(1000); + planningPage.checkSetZosmfAttribute(); + await page.waitForTimeout(1000); + planningPage.enterZosmfHost(ZOSMF_HOST); + await page.waitForTimeout(1000); + planningPage.enterZosmfPort('987776'); + await page.waitForTimeout(1000); + planningPage.enterZosmfApplicationId('ABCDDDETT'); + await page.waitForTimeout(1000); + planningPage.clickValidateLocations(); + await page.waitForTimeout(20000); + const is_GreenCheck_Visible = await planningPage.isValidateLocationsGreenCheckVisible(); + expect(is_GreenCheck_Visible).toBe(false); + const is_Continue_Button_enable = await planningPage.isContinueToInstallationEnabled(); + expect(is_Continue_Button_enable).toBe(false); + }) - test('Test Previous step', async ({ page }) => { - planningPage.clickPreviousStep(); - await page.waitForTimeout(2000); - const title = await connectionPage.getConnectionPageTitle(); - expect(title).toBe(CONNECTION_PAGE_TITLE); - }) + test('Test Previous step', async ({ page }) => { + planningPage.clickPreviousStep(); + await page.waitForTimeout(1000); + const title = await connectionPage.getConnectionPageTitle(); + expect(title).toBe(CONNECTION_PAGE_TITLE); + }) - test('Test Save and Close and Resume Progress', async () => { - planningPage.enterJobStatement(JOB_STATEMENT); - planningPage.clickSaveAndValidate(); - await page.waitForTimeout(20000); - planningPage.enterRuntimeDir(RUNTIME_DIR); - await page.waitForTimeout(2000); - planningPage.enterWorkspaceDir(WORKSPACE_DIR); - await page.waitForTimeout(2000); - planningPage.enterLogsDir(LOG_DIR); - await page.waitForTimeout(2000); - planningPage.enterExtensionsDir(EXTENSIONS_DIR); - await page.waitForTimeout(2000); - planningPage.enterRbacProfileIdentifier(RBAC_IDENTIFIER); - await page.waitForTimeout(2000); - planningPage.enterJobName(JOB_NAME); - await page.waitForTimeout(2000); - planningPage.enterJobPrefix(JOB_PREFIX); - await page.waitForTimeout(2000); - planningPage.enterCookieIdentifier(COOKIE_IDENTIFIER); - await page.waitForTimeout(2000); - planningPage.enterJavaLocation(JAVA_LOCATION); - await page.waitForTimeout(2000); - planningPage.enterNodeJsLocation(NODEJS_LOCATION); - await page.waitForTimeout(2000); - planningPage.clickValidateLocations(); - await page.waitForTimeout(20000); - planningPage.clickSaveAndClose(); - await page.waitForTimeout(3000); - titlePage.clickOnResumeProgress(); - await page.waitForTimeout(5000); - const title = await planningPage.getPlanningPageTitle(); - expect(title).toBe(PLANNING_TITLE); - const is_GreenCheck_Visible = await planningPage.isValidateLocationsGreenCheckVisible(); - expect(is_GreenCheck_Visible).toBe(true); - const is_Continue_Button_enable = await planningPage.isContinueToInstallationEnabled(); - expect(is_Continue_Button_enable).toBe(true); - }) + test('Test Save and Close and Resume Progress', async () => { + planningPage.validateJobStatement(JOB_STATEMENT); + await page.waitForTimeout(20000); + planningPage.enterRuntimeDir(RUNTIME_DIR); + await page.waitForTimeout(1000); + planningPage.enterWorkspaceDir(WORKSPACE_DIR); + await page.waitForTimeout(1000); + planningPage.enterLogsDir(LOG_DIR); + await page.waitForTimeout(1000); + planningPage.enterExtensionsDir(EXTENSIONS_DIR); + await page.waitForTimeout(1000); + planningPage.enterRbacProfileIdentifier(RBAC_IDENTIFIER); + await page.waitForTimeout(1000); + planningPage.enterJobName(JOB_NAME); + await page.waitForTimeout(1000); + planningPage.enterJobPrefix(JOB_PREFIX); + await page.waitForTimeout(1000); + planningPage.enterCookieIdentifier(COOKIE_IDENTIFIER); + await page.waitForTimeout(1000); + planningPage.enterJavaLocation(JAVA_LOCATION); + await page.waitForTimeout(1000); + planningPage.enterNodeJsLocation(NODEJS_LOCATION); + await page.waitForTimeout(1000); + planningPage.clickValidateLocations(); + await page.waitForTimeout(20000); + planningPage.clickSaveAndClose(); + await page.waitForTimeout(3000); + titlePage.clickOnResumeProgress(); + await page.waitForTimeout(5000); + const title = await planningPage.getPlanningPageTitle(); + expect(title).toBe(PLANNING_TITLE); + const is_GreenCheck_Visible = await planningPage.isValidateLocationsGreenCheckVisible(); + expect(is_GreenCheck_Visible).toBe(true); + const is_Continue_Button_enable = await planningPage.isContinueToInstallationEnabled(); + expect(is_Continue_Button_enable).toBe(true); }) +}) diff --git a/playwright_test/Tests/Review.spec.ts b/playwright_test/Tests/Review.spec.ts index 03d162e7..590516bc 100644 --- a/playwright_test/Tests/Review.spec.ts +++ b/playwright_test/Tests/Review.spec.ts @@ -25,37 +25,37 @@ const REVIEW_PAGE_TITLE = 'Review Installation'; const FINISH_INSTALLATION_PAGE_TITLE = 'Finish Installation' const RUNTIME_DIR = process.env.ZOWE_ROOT_DIR; const SSH_HOST = process.env.SSH_HOST; -const SSH_PASSWD = process.env.SSH_PASSWD; +const SSH_PASSWD = process.env.SSH_PASSWD; const SSH_PORT = process.env.SSH_PORT; const SSH_USER = process.env.SSH_USER; -const ZOWE_EXTENSION_DIR= process.env.ZOWE_EXTENSION_DIR; -const ZOWE_LOG_DIR=process.env.ZOWE_LOG_DIR; -const ZOWE_WORKSPACE_DIR=process.env.ZOWE_WORKSPACE_DIR; -const JOB_NAME= process.env.JOB_NAME; -const JOB_PREFIX=process.env.JOB_PREFIX; -const JAVA_HOME=process.env.JAVA_HOME; -const NODE_HOME=process.env.NODE_HOME; -const ZOSMF_HOST=process.env.ZOSMF_HOST; -const ZOSMF_PORT=process.env.ZOSMF_PORT; -const ZOSMF_APP_ID=process.env.ZOSMF_APP_ID; +const ZOWE_EXTENSION_DIR = process.env.ZOWE_EXTENSION_DIR; +const ZOWE_LOG_DIR = process.env.ZOWE_LOG_DIR; +const ZOWE_WORKSPACE_DIR = process.env.ZOWE_WORKSPACE_DIR; +const JOB_NAME = process.env.JOB_NAME; +const JOB_PREFIX = process.env.JOB_PREFIX; +const JAVA_HOME = process.env.JAVA_HOME; +const NODE_HOME = process.env.NODE_HOME; +const ZOSMF_HOST = process.env.ZOSMF_HOST; +const ZOSMF_PORT = process.env.ZOSMF_PORT; +const ZOSMF_APP_ID = process.env.ZOSMF_APP_ID; test.describe('ReviewTab', () => { - let titlePage : TitlePage; + let titlePage: TitlePage; let connectionPage: ConnectionPage; - let planningPage : PlanningPage; - let installationTypePage : InstallationTypePage; - let installationPage : InstallationPage; - let networkingPage : NetworkingPage - let apfAuthPage : ApfAuthPage - let securityPage : SecurityPage - let certificatesPage : CertificatesPage; - let launchConfigPage : LaunchConfigPage; - let reviewPage : ReviewPage; + let planningPage: PlanningPage; + let installationTypePage: InstallationTypePage; + let installationPage: InstallationPage; + let networkingPage: NetworkingPage + let apfAuthPage: ApfAuthPage + let securityPage: SecurityPage + let certificatesPage: CertificatesPage; + let launchConfigPage: LaunchConfigPage; + let reviewPage: ReviewPage; test.beforeEach(async ({ page }) => { test.setTimeout(900000); electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) - page= await electronApp.firstWindow() + page = await electronApp.firstWindow() titlePage = new TitlePage(page); connectionPage = new ConnectionPage(page); planningPage = new PlanningPage(page); @@ -68,17 +68,13 @@ test.describe('ReviewTab', () => { launchConfigPage = new LaunchConfigPage(page); reviewPage = new ReviewPage(page); titlePage.navigateToConnectionTab() - connectionPage.fillConnectionDetails(SSH_HOST,SSH_PORT,SSH_USER,SSH_PASSWD) - await page.waitForTimeout(5000); - connectionPage.SubmitValidateCredential() + connectionPage.performLogin(SSH_HOST, SSH_PORT, SSH_USER, SSH_PASSWD) await page.waitForTimeout(5000); connectionPage.clickContinueButton() await page.waitForTimeout(2000); - planningPage.clickSaveValidate() + planningPage.insertValidateJobStatement() await page.waitForTimeout(10000); - planningPage.fillPlanningPageWithRequiredFields(RUNTIME_DIR, ZOWE_WORKSPACE_DIR,ZOWE_EXTENSION_DIR,ZOWE_LOG_DIR,'1',JOB_NAME,JOB_PREFIX,JAVA_HOME,NODE_HOME,ZOSMF_HOST,ZOSMF_PORT,ZOSMF_APP_ID) - await page.waitForTimeout(20000); - planningPage.clickValidateLocations() + planningPage.validatePlanningStageLocations(RUNTIME_DIR, ZOWE_WORKSPACE_DIR, ZOWE_EXTENSION_DIR, ZOWE_LOG_DIR, '1', JOB_NAME, JOB_PREFIX, JAVA_HOME, NODE_HOME, ZOSMF_HOST, ZOSMF_PORT, ZOSMF_APP_ID) await page.waitForTimeout(20000); planningPage.clickContinueToInstallation() await page.waitForTimeout(2000); @@ -110,7 +106,7 @@ test.describe('ReviewTab', () => { expect(reviewPage.previousStep).toBeTruthy() const is_Finish_Button_disable = await reviewPage.isFinishInstallationDisabled(); expect(is_Finish_Button_disable).toBe(true); - }) + }) test('Test Navigation to Connection page', async ({ page }) => { await page.waitForTimeout(5000); @@ -248,7 +244,7 @@ test.describe('ReviewTab', () => { await page.waitForTimeout(2000); }) - test('Test Save and Close and Resume Progress', async ({page}) => { + test('Test Save and Close and Resume Progress', async ({ page }) => { await page.waitForTimeout(5000); reviewPage.clickSaveAndClose(); await page.waitForTimeout(3000); @@ -256,5 +252,5 @@ test.describe('ReviewTab', () => { await page.waitForTimeout(5000); const title = await reviewPage.getReviewPageTitle(); expect(title).toBe(REVIEW_PAGE_TITLE); - }) + }) }) diff --git a/playwright_test/Tests/Security.spec.ts b/playwright_test/Tests/Security.spec.ts index 2f3af785..6cfb21dc 100644 --- a/playwright_test/Tests/Security.spec.ts +++ b/playwright_test/Tests/Security.spec.ts @@ -5,30 +5,27 @@ import ApfAuthPage from '../Pages/ApfAuth.page'; import TitlePage from '../Pages/title.page'; import ConnectionPage from '../Pages/connection.page'; import PlanningPage from '../Pages/planning.page'; -import path from 'path'; -let page: Page; - let electronApp: ElectronApplication const CERTIFICATE_TITLE = 'Certificates' const SECURITY_TITLE = 'Security' -const APF_AUTH_TITLE ='APF Authorize Load Libraries' +const APF_AUTH_TITLE = 'APF Authorize Load Libraries' const ZOWE_ROOT_DIR = process.env.ZOWE_ROOT_DIR; const SSH_HOST = process.env.SSH_HOST; -const SSH_PASSWD = process.env.SSH_PASSWD; +const SSH_PASSWD = process.env.SSH_PASSWD; const SSH_PORT = process.env.SSH_PORT; const SSH_USER = process.env.SSH_USER; -const ZOWE_EXTENSION_DIR= process.env.ZOWE_EXTENSION_DIR; -const ZOWE_LOG_DIR=process.env.ZOWE_LOG_DIR; -const ZOWE_WORKSPACE_DIR=process.env.ZOWE_WORKSPACE_DIR; -const JOB_NAME= process.env.JOB_NAME; -const JOB_PREFIX=process.env.JOB_PREFIX; -const JAVA_HOME=process.env.JAVA_HOME; -const NODE_HOME=process.env.NODE_HOME; -const ZOSMF_HOST=process.env.ZOSMF_HOST; -const ZOSMF_PORT=process.env.ZOSMF_PORT; -const ZOSMF_APP_ID=process.env.ZOSMF_APP_ID; -const SECURITY_ADMIN= process.env.SECURITY_ADMIN; +const ZOWE_EXTENSION_DIR = process.env.ZOWE_EXTENSION_DIR; +const ZOWE_LOG_DIR = process.env.ZOWE_LOG_DIR; +const ZOWE_WORKSPACE_DIR = process.env.ZOWE_WORKSPACE_DIR; +const JOB_NAME = process.env.JOB_NAME; +const JOB_PREFIX = process.env.JOB_PREFIX; +const JAVA_HOME = process.env.JAVA_HOME; +const NODE_HOME = process.env.NODE_HOME; +const ZOSMF_HOST = process.env.ZOSMF_HOST; +const ZOSMF_PORT = process.env.ZOSMF_PORT; +const ZOSMF_APP_ID = process.env.ZOSMF_APP_ID; +const SECURITY_ADMIN = process.env.SECURITY_ADMIN; const SECURITY_STC = process.env.SECURITY_STC; const SECURITY_SYSPROG = process.env.SECURITY_SYSPROG; const SECURITY_USER_ZIS = process.env.SECURITY_USER_ZIS; @@ -47,180 +44,173 @@ test.beforeAll(async () => { }); test.describe('securityTab', () => { - let connectionPage: ConnectionPage; - let titlePage : TitlePage; - let securityPage : SecurityPage; - let planningPage : PlanningPage; - let apfAuthPage : ApfAuthPage; - - - test.beforeEach(async ({ page }) => { - test.setTimeout(900000); - electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) - page= await electronApp.firstWindow() - connectionPage = new ConnectionPage(page); - titlePage = new TitlePage(page); - planningPage = new PlanningPage(page); - apfAuthPage = new ApfAuthPage(page); - securityPage = new SecurityPage(page); - titlePage.navigateToConnectionTab() - connectionPage.fillConnectionDetails(SSH_HOST,SSH_PORT,SSH_USER,SSH_PASSWD) - connectionPage.SubmitValidateCredential() - await page.waitForTimeout(5000); - connectionPage.clickContinueButton() - planningPage.clickSaveValidate() - await page.waitForTimeout(20000); - planningPage.fillPlanningPageWithRequiredFields(ZOWE_ROOT_DIR, ZOWE_WORKSPACE_DIR,ZOWE_EXTENSION_DIR,ZOWE_LOG_DIR,'1',JOB_NAME,JOB_PREFIX,JAVA_HOME,NODE_HOME,ZOSMF_HOST,ZOSMF_PORT,ZOSMF_APP_ID) - await page.waitForTimeout(20000); - planningPage.clickValidateLocations() - await page.waitForTimeout(20000); - planningPage.clickContinueToInstallation() - await page.waitForTimeout(5000); - securityPage.movetoSecurityPage() - await page.waitForTimeout(5000); - }) - - test.afterEach(async () => { - await electronApp.close() - }) - - test('Test all required fields on security page', async ({ page }) => { - await page.waitForTimeout(5000); - await expect(securityPage.product).toBeTruthy() - await expect(securityPage.admin).toBeTruthy() - await expect(securityPage.stc).toBeTruthy() - await expect(securityPage.sys_prog).toBeTruthy() - await expect(securityPage.user_zis).toBeTruthy() - await expect(securityPage.user_zowe).toBeTruthy() - await expect(securityPage.aux).toBeTruthy() - await expect(securityPage.stc_zowe).toBeTruthy() - await expect(securityPage.stc_zis).toBeTruthy() - await expect(securityPage.view_yaml).toBeTruthy() - await expect(securityPage.save_and_close).toBeTruthy() - await expect(securityPage.previous_step).toBeTruthy() - await expect(securityPage.skip_button).toBeTruthy() - await expect(securityPage.continue_CertificateSelector).toBeTruthy() - - }) - test('test security with empty data', async ({ page }) => { - await page.waitForTimeout(5000); - securityPage.fillSecurityDetails('','','','','','','','','') - await page.waitForTimeout(5000); - securityPage.initializeSecurity() - await page.waitForTimeout(15000); - const isWriteConfig_check_visible = await securityPage.isWriteConfigGreenCheckVisible(); - expect(isWriteConfig_check_visible).toBe(false); - const isUploadConfig_check_visible = await securityPage.isUploadConfigGreenCheckVisible(); - expect(isUploadConfig_check_visible).toBe(false); - const isInitSecurity_check_visible = await securityPage.isInitSecurityGreenCheckVisible(); - expect(isInitSecurity_check_visible).toBe(false); - await page.waitForTimeout(15000); - - }) - test('test security with valid data', async ({ page }) => { - await page.waitForTimeout(5000); - securityPage.fillSecurityDetails('RACF',SECURITY_ADMIN,SECURITY_STC,SECURITY_SYSPROG,SECURITY_USER_ZIS,SECURITY_USER_ZOWE,SECURITY_AUX,SECURITY_STC_ZOWE,SECURITY_STC_ZIS) - await page.waitForTimeout(5000); - securityPage.initializeSecurity() - await page.waitForTimeout(5000); - const isWriteConfig_check_visible = await securityPage.isWriteConfigGreenCheckVisible(); - expect(isWriteConfig_check_visible).toBe(true); - const isUploadConfig_check_visible = await securityPage.isUploadConfigGreenCheckVisible(); - expect(isUploadConfig_check_visible).toBe(true); - const isInitSecurity_check_visible = await securityPage.isInitSecurityGreenCheckVisible(); - expect(isInitSecurity_check_visible).toBe(true); - await page.waitForTimeout(5000); - - }) - - test('click Previous step button', async ({ page }) => { - await page.waitForTimeout(5000); - const title = await securityPage.returnTitleOfPrevPage(); - expect(title).toBe(APF_AUTH_TITLE); - }) - - - test('test click skip security button', async ({ page }) => { - await page.waitForTimeout(5000); - const certificate_title = await securityPage.click_skipSecurity(); - expect(certificate_title).toBe(CERTIFICATE_TITLE); - }) - - - test('Test previous button is enabled', async ({ page }) => { - const is_prevButtonEnable = await securityPage.isPreviousButtonEnable(); - expect(is_prevButtonEnable).toBe(true); - await page.waitForTimeout(2000); - }) - - test('Test continue to certificate button is disable', async ({ page }) => { - await page.waitForTimeout(2000); - const is_ContinueButtonDisable = await securityPage.isContinueButtonDisable(); - expect(is_ContinueButtonDisable).toBe(true); - await page.waitForTimeout(2000); - }) - - test('Test Skip security button is enable', async ({ page }) => { - await page.waitForTimeout(2000); - const isSkipSecurityEnable = await securityPage.is_skipSecurityButtonEnable(); - expect(isSkipSecurityEnable).toBe(true); - await page.waitForTimeout(2000); - }) - - - test('Test view yaml button', async ({ page }) => { - await page.waitForTimeout(7000); - securityPage.viewYaml() - await page.waitForTimeout(5000); - await expect(securityPage.editor_title_element).toBeTruthy(); - securityPage.closeButton() - await page.waitForTimeout(2000); - }) - - test('Test view and submit button', async ({ page }) => { - await page.waitForTimeout(5000); - securityPage.click_viewAndSubmitJob() - await page.waitForTimeout(5000); - await expect(securityPage.editor_title_element).toBeTruthy() - securityPage.closeButton() - await page.waitForTimeout(2000); - }) - - - test('Test view job', async ({ page }) => { - await page.waitForTimeout(5000); - securityPage.click_previewJob() - await page.waitForTimeout(5000); - await expect(securityPage.editor_title_element).toBeTruthy() - securityPage.closeButton() - await page.waitForTimeout(5000); - }) - - test('Test save and close and Resume Progress', async ({ page }) => { - await page.waitForTimeout(5000); - securityPage.fillSecurityDetails('RACF',SECURITY_ADMIN,SECURITY_STC,SECURITY_SYSPROG,SECURITY_USER_ZIS,SECURITY_USER_ZOWE,SECURITY_AUX,SECURITY_STC_ZOWE,SECURITY_STC_ZIS) - await page.waitForTimeout(5000); - securityPage.click_saveAndClose() - await page.waitForTimeout(3000); - titlePage.clickOnResumeProgress(); - await page.waitForTimeout(15000); - const title = await securityPage.returnTitleOfSecurityPage(); - expect(title).toBe(SECURITY_TITLE); - const sysProg_value = await securityPage.get_sysProg_value(); - const admin_value = await securityPage.get_admin_value(); - const stc_value = await securityPage.get_stc_value(); - const userZowe_value = await securityPage.get_user_zowe_value(); - const userZis_value = await securityPage.get_user_zis_value(); - const aux_value = await securityPage.get_aux_value(); - const stcZis_value = await securityPage.get_stc_zis_value(); - const stcZowe_value = await securityPage.get_stc_zowe_value(); - expect(sysProg_value).toBe(process.env.SECURITY_SYSPROG); - expect(admin_value).toBe(process.env.SECURITY_ADMIN); - expect(stc_value).toBe(process.env.SECURITY_STC); - expect(userZowe_value).toBe(process.env.SECURITY_USER_ZOWE); - expect(userZis_value).toBe(process.env.SECURITY_USER_ZIS); - expect(stcZowe_value).toBe(process.env.SECURITY_STC_ZOWE); - expect(stcZis_value).toBe(process.env.SECURITY_STC_ZIS); - expect(aux_value).toBe(process.env.SECURITY_AUX); - }) + let connectionPage: ConnectionPage; + let titlePage: TitlePage; + let securityPage: SecurityPage; + let planningPage: PlanningPage; + let apfAuthPage: ApfAuthPage; + + test.beforeEach(async ({ page }) => { + test.setTimeout(900000); + electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) + page = await electronApp.firstWindow() + connectionPage = new ConnectionPage(page); + titlePage = new TitlePage(page); + planningPage = new PlanningPage(page); + apfAuthPage = new ApfAuthPage(page); + securityPage = new SecurityPage(page); + titlePage.navigateToConnectionTab() + connectionPage.performLogin(SSH_HOST, SSH_PORT, SSH_USER, SSH_PASSWD) + await page.waitForTimeout(5000); + connectionPage.clickContinueButton() + planningPage.insertValidateJobStatement() + await page.waitForTimeout(20000); + planningPage.validatePlanningStageLocations(ZOWE_ROOT_DIR, ZOWE_WORKSPACE_DIR, ZOWE_EXTENSION_DIR, ZOWE_LOG_DIR, '1', JOB_NAME, JOB_PREFIX, JAVA_HOME, NODE_HOME, ZOSMF_HOST, ZOSMF_PORT, ZOSMF_APP_ID) + await page.waitForTimeout(20000); + planningPage.clickContinueToInstallation() + await page.waitForTimeout(5000); + securityPage.movetoSecurityPage() + await page.waitForTimeout(5000); + }) + + test.afterEach(async () => { + await electronApp.close() + }) + + test('Test all required fields on security page', async ({ page }) => { + await page.waitForTimeout(5000); + expect(securityPage.product).toBeTruthy() + expect(securityPage.admin).toBeTruthy() + expect(securityPage.stc).toBeTruthy() + expect(securityPage.sys_prog).toBeTruthy() + expect(securityPage.user_zis).toBeTruthy() + expect(securityPage.user_zowe).toBeTruthy() + expect(securityPage.aux).toBeTruthy() + expect(securityPage.stc_zowe).toBeTruthy() + expect(securityPage.stc_zis).toBeTruthy() + expect(securityPage.view_yaml).toBeTruthy() + expect(securityPage.save_and_close).toBeTruthy() + expect(securityPage.previous_step).toBeTruthy() + expect(securityPage.skip_button).toBeTruthy() + expect(securityPage.continue_CertificateSelector).toBeTruthy() + }) + + test('test security with empty data', async ({ page }) => { + await page.waitForTimeout(5000); + securityPage.fillSecurityDetails('', '', '', '', '', '', '', '', '') + await page.waitForTimeout(5000); + securityPage.initializeSecurity() + await page.waitForTimeout(15000); + const isWriteConfig_check_visible = await securityPage.isWriteConfigGreenCheckVisible(); + expect(isWriteConfig_check_visible).toBe(false); + const isUploadConfig_check_visible = await securityPage.isUploadConfigGreenCheckVisible(); + expect(isUploadConfig_check_visible).toBe(false); + const isInitSecurity_check_visible = await securityPage.isInitSecurityGreenCheckVisible(); + expect(isInitSecurity_check_visible).toBe(false); + await page.waitForTimeout(15000); + }) + + test('test security with valid data', async ({ page }) => { + await page.waitForTimeout(5000); + securityPage.fillSecurityDetails('RACF', SECURITY_ADMIN, SECURITY_STC, SECURITY_SYSPROG, SECURITY_USER_ZIS, SECURITY_USER_ZOWE, SECURITY_AUX, SECURITY_STC_ZOWE, SECURITY_STC_ZIS) + await page.waitForTimeout(5000); + securityPage.initializeSecurity() + await page.waitForTimeout(5000); + const isWriteConfig_check_visible = await securityPage.isWriteConfigGreenCheckVisible(); + expect(isWriteConfig_check_visible).toBe(true); + const isUploadConfig_check_visible = await securityPage.isUploadConfigGreenCheckVisible(); + expect(isUploadConfig_check_visible).toBe(true); + const isInitSecurity_check_visible = await securityPage.isInitSecurityGreenCheckVisible(); + expect(isInitSecurity_check_visible).toBe(true); + await page.waitForTimeout(5000); + }) + + test('click Previous step button', async ({ page }) => { + await page.waitForTimeout(5000); + const title = await securityPage.returnTitleOfPrevPage(); + expect(title).toBe(APF_AUTH_TITLE); + }) + + test('test click skip security button', async ({ page }) => { + await page.waitForTimeout(5000); + const certificate_title = await securityPage.click_skipSecurity(); + expect(certificate_title).toBe(CERTIFICATE_TITLE); + }) + + test('Test previous button is enabled', async ({ page }) => { + const is_prevButtonEnable = await securityPage.isPreviousButtonEnable(); + expect(is_prevButtonEnable).toBe(true); + await page.waitForTimeout(2000); + }) + + test('Test continue to certificate button is disable', async ({ page }) => { + await page.waitForTimeout(2000); + const is_ContinueButtonDisable = await securityPage.isContinueButtonDisable(); + expect(is_ContinueButtonDisable).toBe(true); + await page.waitForTimeout(2000); + }) + + test('Test Skip security button is enable', async ({ page }) => { + await page.waitForTimeout(2000); + const isSkipSecurityEnable = await securityPage.is_skipSecurityButtonEnable(); + expect(isSkipSecurityEnable).toBe(true); + await page.waitForTimeout(2000); + }) + + + test('Test view yaml button', async ({ page }) => { + await page.waitForTimeout(7000); + securityPage.viewYaml() + await page.waitForTimeout(5000); + expect(securityPage.editor_title_element).toBeTruthy(); + securityPage.closeButton() + await page.waitForTimeout(2000); + }) + + test('Test view and submit button', async ({ page }) => { + await page.waitForTimeout(5000); + securityPage.click_viewAndSubmitJob() + await page.waitForTimeout(5000); + expect(securityPage.editor_title_element).toBeTruthy() + securityPage.closeButton() + await page.waitForTimeout(2000); + }) + + + test('Test view job', async ({ page }) => { + await page.waitForTimeout(5000); + securityPage.click_previewJob() + await page.waitForTimeout(5000); + expect(securityPage.editor_title_element).toBeTruthy() + securityPage.closeButton() + await page.waitForTimeout(5000); + }) + + test('Test save and close and Resume Progress', async ({ page }) => { + await page.waitForTimeout(5000); + securityPage.fillSecurityDetails('RACF', SECURITY_ADMIN, SECURITY_STC, SECURITY_SYSPROG, SECURITY_USER_ZIS, SECURITY_USER_ZOWE, SECURITY_AUX, SECURITY_STC_ZOWE, SECURITY_STC_ZIS) + await page.waitForTimeout(5000); + securityPage.click_saveAndClose() + await page.waitForTimeout(3000); + titlePage.clickOnResumeProgress(); + await page.waitForTimeout(15000); + const title = await securityPage.returnTitleOfSecurityPage(); + expect(title).toBe(SECURITY_TITLE); + const sysProg_value = await securityPage.get_sysProg_value(); + const admin_value = await securityPage.get_admin_value(); + const stc_value = await securityPage.get_stc_value(); + const userZowe_value = await securityPage.get_user_zowe_value(); + const userZis_value = await securityPage.get_user_zis_value(); + const aux_value = await securityPage.get_aux_value(); + const stcZis_value = await securityPage.get_stc_zis_value(); + const stcZowe_value = await securityPage.get_stc_zowe_value(); + expect(sysProg_value).toBe(process.env.SECURITY_SYSPROG); + expect(admin_value).toBe(process.env.SECURITY_ADMIN); + expect(stc_value).toBe(process.env.SECURITY_STC); + expect(userZowe_value).toBe(process.env.SECURITY_USER_ZOWE); + expect(userZis_value).toBe(process.env.SECURITY_USER_ZIS); + expect(stcZowe_value).toBe(process.env.SECURITY_STC_ZOWE); + expect(stcZis_value).toBe(process.env.SECURITY_STC_ZIS); + expect(aux_value).toBe(process.env.SECURITY_AUX); + }) }) \ No newline at end of file diff --git a/playwright_test/Tests/titleTab.spec.ts b/playwright_test/Tests/titleTab.spec.ts index 1a4ef432..7f86644c 100644 --- a/playwright_test/Tests/titleTab.spec.ts +++ b/playwright_test/Tests/titleTab.spec.ts @@ -4,25 +4,25 @@ import TitlePage from '../Pages/title.page'; let electronApp: ElectronApplication test.describe('Home', () => { - let titlePage: TitlePage; - - test.beforeEach(async ({ page }) => { - electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) - page= await electronApp.firstWindow() - titlePage = new TitlePage(page); - - }) - - test('Open HomePage and verify title', async ({ page }) => { - // verify title - // page = await electronApp.firstWindow() - await expect(page).toHaveTitle('Zowe Enterprise Necessity'); - }) + let titlePage: TitlePage; - test('Verify install buttons', async ({ page }) => { - // verify title - //page = await electronApp.firstWindow() - await expect(titlePage.zoweInstallButton).toBeVisible() - await expect(titlePage.zoweDryrunButton).toBeVisible() - }) + test.beforeEach(async ({ page }) => { + electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) + page = await electronApp.firstWindow() + titlePage = new TitlePage(page); + + }) + + test('Open HomePage and verify title', async ({ page }) => { + // verify title + // page = await electronApp.firstWindow() + await expect(page).toHaveTitle('Zowe Enterprise Necessity'); + }) + + test('Verify install buttons', async ({ page }) => { + // verify title + //page = await electronApp.firstWindow() + await expect(titlePage.zoweInstallButton).toBeVisible() + await expect(titlePage.zoweDryrunButton).toBeVisible() + }) }) \ No newline at end of file