diff --git a/playwright_test/Pages/apfAuth.page.ts b/playwright_test/Pages/apfAuth.page.ts index 8d7b51b..0a0f20c 100644 --- a/playwright_test/Pages/apfAuth.page.ts +++ b/playwright_test/Pages/apfAuth.page.ts @@ -13,6 +13,7 @@ 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; @@ -41,6 +42,11 @@ class ApfAuthPage{ dataset_prefix_value:Locator; apf_auth_tab: Locator; + + + + + constructor(page: Page) { this.page = page; this.continueButtonSelector = page.locator('.MuiButton-containedPrimary.MuiButton-sizeMedium') @@ -82,8 +88,13 @@ class ApfAuthPage{ //this.select_SMPE = page.getByLabel('//button[contains(text(),"SMP/E")]') this.select_SMPE = page.locator('span:has-text("SMP/E")'); - + this.apf_auth_tab = page.locator("//span[text()='APF Auth']") } + + async clickApfAuthTab(){ + await this.apf_auth_tab.click({timeout: 9000}) + } + async returnTitleOfApfAuthPage(){ const ApfAuthTitle = await this.APFAUTH_TITLE.textContent(); return ApfAuthTitle; @@ -94,6 +105,13 @@ class ApfAuthPage{ await this.click_ApfAuth.click({timeout: 9000}) } + async movetoInstallationPage(){ + await this.page.waitForTimeout(5000) + await this.click_Installation.click({timeout: 9000}) + } + async isContinueButtonEnabled(){ + return await this.continue_security_setup.isEnabled(); + } async selectInstallationType(){ await this.select_SMPE.waitFor({ state: 'visible', timeout: 9000 }); // Adjust timeout if needed console.log('SMP/E span is visible.'); @@ -174,14 +192,9 @@ class ApfAuthPage{ return editor_title; } - async isContinueButtonEnabled(){ - return await this.continue_security_setup.isEnabled({ timeout: 5000 }); - } - - async isContinueButtonDisable(){ + async isContinueButtonDisable(){ return await this.continue_security_setup.isDisabled({ timeout: 5000 }); } - async click_saveAndClose(){ this.save_and_close.click({ timeout: 2000 }) } diff --git a/playwright_test/Pages/connection.page.ts b/playwright_test/Pages/connection.page.ts index adf3a62..b7cd909 100644 --- a/playwright_test/Pages/connection.page.ts +++ b/playwright_test/Pages/connection.page.ts @@ -57,6 +57,11 @@ class ConnectionPage{ return await this.connectionPageTitle.textContent(); } + async fillPassword(password: string){ + await this.page.waitForTimeout(2000); + await this.password.fill(password); + } + async SubmitValidateCredential(){ console.log("Submitting credentials..."); await this.validateCredential.click(); diff --git a/playwright_test/Pages/installationType.page.ts b/playwright_test/Pages/installationType.page.ts index 11e8442..dae7457 100644 --- a/playwright_test/Pages/installationType.page.ts +++ b/playwright_test/Pages/installationType.page.ts @@ -18,7 +18,8 @@ class InstallationTypePage{ validateLocationGreenCheck: Locator; licenseAgreementGreenCheck: Locator; disagreeLicense: Locator; - + installation_Type_Tab: Locator; + continueToUnpaxButton: Locator; constructor(page: Page) { this.page = page; @@ -33,7 +34,7 @@ class InstallationTypePage{ this.continueToComponentInstallation = page.locator("//button[text()='Continue to Components Installation']") this.zoweLink = page.locator("//a[@href='zowe.org']") this.agreeLicense = page.locator("//button[text()='Agree']") - this.disagreeLicense = page.locator("//button[text()='Agree']") + this.disagreeLicense = page.locator("//button[text()='Disagree']") this.uploadPaxButton = page.locator("//button[text()='Upload PAX']") this.runtimeDir = page.locator("//label[contains(text(),'Runtime Directory')]//following-sibling::div/input") this.validateLocation = page.locator("//button[text()= 'Validate location']") @@ -42,12 +43,17 @@ class InstallationTypePage{ this.retrieveExampleZoweYaml = page.locator("//button[contains(text(),'Retrieve example-zowe.yaml')]") this.continueCompInstallation = page.locator("//button[contains(text(),'Continue to Components Installation')]") this.skipUnpaxButton = page.locator("//button[text()='Skip ']") - this.continueToUnpax = page.locator("//button[contains(text(),'Continue to Unpax')]") + this.continueToUnpaxButton = page.locator("//button[contains(text(),'Continue to Unpax')]") this.SkipUnpax = page.locator('//button[contains(text(),"Skip")]') this.retrieveExampleZoweYaml= page.locator('//button[contains(text(),"Retrieve example-zowe.yaml")]') this.click_InitializationStage = page.locator('//span[text()="Initialization"]') + this.installation_Type_Tab = page.locator('//span[text()="Installation Type"]') } + async clickInstallationTypeTab(){ + await this.installation_Type_Tab.click({timeout: 9000}) + } + async getInstallationTypePageTitle(){ return await this.pageTitle.textContent({ timeout: 2000 }); } @@ -200,7 +206,11 @@ class InstallationTypePage{ this.clickValidateLocation() } async clickOnContinueToUnpax(){ - this.continueToUnpax.click({ timeout: 2000 }) + this.continueToUnpaxButton.click({ timeout: 2000 }) + } + + async isContinueToUnpaxEnabled(){ + return await this.continueToUnpaxButton.isEnabled() } async clickSkipUnpaxButton(){ diff --git a/playwright_test/Pages/planning.page.ts b/playwright_test/Pages/planning.page.ts index 6d14485..091fe43 100644 --- a/playwright_test/Pages/planning.page.ts +++ b/playwright_test/Pages/planning.page.ts @@ -229,6 +229,23 @@ class PlanningPage{ await this.previousStep.click(); } + private async waitForContinueButtonToBeEnabled(): Promise { + const timeout = 100000; // Adjust the timeout as needed + const interval = 500; + const endTime = Date.now() + timeout; + + while (Date.now() < endTime) { + if (await this.isContinueToInstallationEnabled()) { + console.log("Continue button is enabled."); + return true; // Button became enabled + } + await this.page.waitForTimeout(interval); + } + + console.log("Continue button did not enabled "); + return false; // Button did not become enabled + } + async clickContinueToInstallation(){ const timeout = 30000; const interval = 100; @@ -271,7 +288,7 @@ class PlanningPage{ } - 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, javaLocation:any,nodejsLocation:any,zOSMFHost:any,zOSMFPort:any,zOSMFAppID:any){ await this.clickSaveValidate(); await this.enterRuntimeDir(runtimeDir); await this.enterWorkspaceDir(workspaceDir); @@ -279,11 +296,10 @@ class PlanningPage{ await this.enterExtensionsDir(extensionDir); await this.enterJavaLocation(javaLocation); await this.enterNodeJsLocation(nodejsLocation); - //await this.enterZosmfHost(zOSMFHost); - //await this.enterZosmfPort(zOSMFPort); + await this.enterZosmfHost(zOSMFHost); + await this.enterZosmfPort(zOSMFPort); await this.enterZosmfApplicationId(zOSMFAppID); await this.page.waitForTimeout(2000); } - } export default PlanningPage; diff --git a/playwright_test/Pages/security.page.ts b/playwright_test/Pages/security.page.ts index 5161d29..017afa2 100644 --- a/playwright_test/Pages/security.page.ts +++ b/playwright_test/Pages/security.page.ts @@ -30,7 +30,8 @@ class SecurityPage{ product: Locator; APFAUTH_TITLE: Locator; continueToComponentInstallation: Locator; - security_tab: Locator; + + constructor(page: Page) { this.page = page; @@ -66,9 +67,6 @@ class SecurityPage{ this.user_zis = page.locator(this.mainXpath +'/div/div/div[2]/div/label'); this.user_zowe = page.locator(this.mainXpath +'/div/div/div[1]/div/label'); 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.security_tab = page.locator("//span[text()='Security']") this.stc_zowe = page.locator(this.stc_mainXpath + '/div[1]/div/div[1]/div/label'); this.stc_zis = page.locator(this.stc_mainXpath + '/div[1]/div/div[2]/div/label'); @@ -102,10 +100,6 @@ class SecurityPage{ } - async clickSecurityTab(){ - await this.security_tab.click({ timeout: 2000 }) - } - async fillAdmin(admin:string){ await this.admin.fill(admin,{ timeout: 10000 }) } @@ -179,10 +173,6 @@ class SecurityPage{ return editor_title; } - async isContinueButtonEnabled(){ - return await this.continue_CertificateSelector.isEnabled({ timeout: 5000 }); - } - async isContinueButtonDisable(){ return await this.continue_CertificateSelector.isDisabled({ timeout: 5000 }); } diff --git a/playwright_test/Tests/Planning.spec.ts b/playwright_test/Tests/Planning.spec.ts index 716561d..5007d06 100644 --- a/playwright_test/Tests/Planning.spec.ts +++ b/playwright_test/Tests/Planning.spec.ts @@ -90,7 +90,7 @@ test.describe('PlanningTab', () => { }) test('Test Validate Locations with Valid Data', async () => { - await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, + await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, config.ZOWE_WORKSPACE_DIR, config.ZOWE_EXTENSION_DIR, config.ZOWE_LOG_DIR, @@ -125,10 +125,10 @@ test.describe('PlanningTab', () => { const is_Continue_Button_enable = await planningPage.isContinueToInstallationDisabled(); expect(is_Continue_Button_enable).toBe(true); }) - + test('Test Save and Close and Resume Progress', async () => { - await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, + await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, config.ZOWE_WORKSPACE_DIR, config.ZOWE_EXTENSION_DIR, config.ZOWE_LOG_DIR, @@ -139,7 +139,7 @@ test.describe('PlanningTab', () => { config.ZOSMF_APP_ID ); await planningPage.clickValidateLocations() - await planningPage.click_saveAndClose() + await planningPage.click_saveAndClose() await titlePage.clickOnResumeProgress(); await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); await connectionPage.SubmitValidateCredential(); diff --git a/playwright_test/Tests/StateManagementApfAuthSecurity.spec.ts b/playwright_test/Tests/StateManagementApfAuthSecurity.spec.ts deleted file mode 100644 index ffb3544..0000000 --- a/playwright_test/Tests/StateManagementApfAuthSecurity.spec.ts +++ /dev/null @@ -1,170 +0,0 @@ -import { test, ElectronApplication, expect, _electron as electron, Page } from '@playwright/test'; -import ApfAuthPage from '../Pages/ApfAuth.page.js'; -import TitlePage from '../Pages/title.page.js'; -import ConnectionPage from '../Pages/connection.page.js'; -import PlanningPage from '../Pages/planning.page.js'; -import InstallationTypePage from '../Pages/installationType.page.js'; -import InstallationPage from '../Pages/installation.page.js'; -import NetworkingPage from '../Pages/networking.page.js'; -import SecurityPage from '../Pages/security.page'; -let page: Page; - -let electronApp: ElectronApplication -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_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 RUNTIME_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 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; -const SECURITY_USER_ZOWE = process.env.SECURITY_USER_ZOWE; -const SECURITY_AUX = process.env.SECURITY_AUX; -const SECURITY_STC_ZOWE = process.env.SECURITY_STC_ZOWE; -const SECURITY_STC_ZIS = process.env.SECURITY_STC_ZIS; - -test.describe('ApfAuthTab', () => { - let connectionPage: ConnectionPage; - let titlePage : TitlePage; - let apfAuthPage : ApfAuthPage; - let planningPage : PlanningPage; - let installationTypePage : InstallationTypePage; - let installationPage : InstallationPage; - let networkingPage : NetworkingPage - let securityPage : SecurityPage; - - async function launch_Zen_and_Navigate_to_Installation_Tab({ 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); - installationTypePage = new InstallationTypePage(page); - installationPage = new InstallationPage(page); - networkingPage = new NetworkingPage(page); - apfAuthPage = new ApfAuthPage(page); - securityPage = new SecurityPage(page); - await page.waitForTimeout(5000) - titlePage.navigateToConnectionTab(); - connectionPage.fillConnectionDetails(SSH_HOST,SSH_PORT,SSH_USER,SSH_PASSWD) - await page.waitForTimeout(5000); - connectionPage.SubmitValidateCredential(); - 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) - await page.waitForTimeout(20000); - planningPage.clickValidateLocations() - await page.waitForTimeout(20000); - planningPage.clickContinueToInstallation() - await page.waitForTimeout(5000); - installationTypePage.downloadZowePaxAndNavigateToInstallationPage() - installationTypePage.clickContinueToInstallation() - } - - test.beforeEach(async () => { - await launch_Zen_and_Navigate_to_Installation_Tab({page}) - }) - - test.afterEach(async () => { - await electronApp.close() - }) - - test('Test Apf Auth Completed', async ({ page }) => { - await page.waitForTimeout(2000); - apfAuthPage.fillApfDetails(DATASET_PREFIX,AUTH_LOAD_LIB,AUTH_PLUGIN_LIB) - await page.waitForTimeout(5000); - installationPage.clickSkipInstallation() - await page.waitForTimeout(2000); - networkingPage.clickContinueToApfAuth() - await page.waitForTimeout(2000); - 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); - const isContinueSecurityButtonEnabled = await apfAuthPage.isContinueButtonEnabled(); - expect(isContinueSecurityButtonEnabled).toBe(true); - await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Tab({page}) - apfAuthPage.clickApfAuthTab() - await page.waitForTimeout(2000); - expect(isWriteConfig_check_visible).toBe(true); - expect(isUploadConfig_check_visible).toBe(true); - expect(isInitApf_check_visible).toBe(true); - expect(isContinueSecurityButtonEnabled).toBe(true); - }) - - test('Test Apf Auth Pending', async ({ page }) => { - await page.waitForTimeout(2000); - apfAuthPage.fillApfDetails(DATASET_PREFIX,AUTH_LOAD_LIB,AUTH_PLUGIN_LIB) - await page.waitForTimeout(5000); - installationPage.clickSkipInstallation() - await page.waitForTimeout(2000); - const isContinueSecurityButtonEnabled = await apfAuthPage.isContinueButtonEnabled(); - expect(isContinueSecurityButtonEnabled).toBe(false); - await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Tab({page}) - apfAuthPage.clickApfAuthTab() - await page.waitForTimeout(2000); - expect(isContinueSecurityButtonEnabled).toBe(false); - }) - - test('Test Security Setup Completed', 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); - const isContinueCertificatesButtonEnabled = await securityPage.isContinueButtonEnabled(); - expect(isContinueCertificatesButtonEnabled).toBe(true); - await page.waitForTimeout(2000); - await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Tab({page}) - securityPage.clickSecurityTab() - await page.waitForTimeout(2000); - expect(isWriteConfig_check_visible).toBe(true); - expect(isUploadConfig_check_visible).toBe(true); - expect(isInitSecurity_check_visible).toBe(true); - expect(isContinueCertificatesButtonEnabled).toBe(true); - }) - - test('Test Security Setup Pending', 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); - const isContinueCertificatesButtonEnabled = await securityPage.isContinueButtonEnabled(); - expect(isContinueCertificatesButtonEnabled).toBe(false); - await page.waitForTimeout(2000); - await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Tab({page}) - securityPage.clickSecurityTab() - await page.waitForTimeout(2000); - expect(isContinueCertificatesButtonEnabled).toBe(false); - }) - -}) \ No newline at end of file diff --git a/playwright_test/Tests/StateManagementInstallationType.spec.ts b/playwright_test/Tests/StateManagementInstallationType.spec.ts index 414dde3..2ed58ca 100644 --- a/playwright_test/Tests/StateManagementInstallationType.spec.ts +++ b/playwright_test/Tests/StateManagementInstallationType.spec.ts @@ -1,79 +1,50 @@ import { test, ElectronApplication, expect, _electron as electron, Page } from '@playwright/test'; -import TitlePage from '../Pages/title.page.ts'; import ConnectionPage from '../Pages/connection.page.ts'; +import TitlePage from '../Pages/title.page.ts'; import PlanningPage from '../Pages/planning.page.ts'; import InstallationTypePage from '../Pages/installationType.page.ts'; -import InstallationPage from '../Pages/installation.page.ts'; -import NetworkingPage from '../Pages/networking.page.ts'; +import config from '../utils/config.ts'; let page: Page; let electronApp: ElectronApplication -const RUNTIME_DIR = process.env.ZOWE_ROOT_DIR; -const SSH_HOST = process.env.SSH_HOST; -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 NETWORKING_PAGE_TITLE = 'Networking' -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; -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; test.describe('InstallationTypeTab', () => { let connectionPage: ConnectionPage; - let titlePage : TitlePage; - let installationTypePage : InstallationTypePage; - let planningPage : PlanningPage; - let installationPage : InstallationPage; - let networkingPage : NetworkingPage + let titlePage: TitlePage; + let planningPage: PlanningPage; + let installationTypePage: InstallationTypePage; - async function launch_Zen_and_Navigate_to_Installation_Type_Tab({ page }) { + async function launch_Zen({ 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); - networkingPage = new NetworkingPage(page); await page.waitForTimeout(5000) - titlePage.navigateToConnectionTab(); - connectionPage.fillConnectionDetails(SSH_HOST,SSH_PORT,SSH_USER,SSH_PASSWD) - await page.waitForTimeout(5000); - connectionPage.SubmitValidateCredential(); - 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) - await page.waitForTimeout(20000); - planningPage.clickValidateLocations() - await page.waitForTimeout(20000); - planningPage.clickContinueToInstallation() - await page.waitForTimeout(5000); } test.beforeEach(async () => { - await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) + await launch_Zen({page}) + titlePage.navigateToConnectionTab(); + await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); + await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, + config.ZOWE_WORKSPACE_DIR, + config.ZOWE_EXTENSION_DIR, + config.ZOWE_LOG_DIR, + config.JAVA_HOME, + config.NODE_HOME, + config.ZOSMF_HOST, + config.ZOSMF_PORT, + config.ZOSMF_APP_ID + ); + await planningPage.clickValidateLocations() + await planningPage.clickContinueToInstallation() }) - + test.afterEach(async () => { await electronApp.close() }) @@ -83,7 +54,13 @@ test.describe('InstallationTypeTab', () => { const is_Download_Zowe_Pax_Selected = await installationTypePage.isDownloadZowePaxSelected(); expect(is_Download_Zowe_Pax_Selected).toBe(true); await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) + await launch_Zen({page}) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + installationTypePage.clickInstallationTypeTab(); + await page.waitForTimeout(2000); expect(is_Download_Zowe_Pax_Selected).toBe(true); }) @@ -92,7 +69,13 @@ test.describe('InstallationTypeTab', () => { const is_Upload_Zowe_Pax_Selected = await installationTypePage.isUploadZowePaxSelected(); expect(is_Upload_Zowe_Pax_Selected).toBe(true); await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) + await launch_Zen({page}) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + installationTypePage.clickInstallationTypeTab(); + await page.waitForTimeout(2000); expect(is_Upload_Zowe_Pax_Selected).toBe(true); }) @@ -100,10 +83,16 @@ test.describe('InstallationTypeTab', () => { installationTypePage.selectSmpe(); const is_SMPE_Selected = await installationTypePage.isSmpeSelected(); expect(is_SMPE_Selected).toBe(true); - const Is_Continue_Button_Enable = await installationTypePage.isContinueToComponentInstallationEnabled(); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); expect(Is_Continue_Button_Enable).toBe(true); await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) + await launch_Zen({page}) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + installationTypePage.clickInstallationTypeTab(); + await page.waitForTimeout(2000); expect(is_SMPE_Selected).toBe(true); expect(Is_Continue_Button_Enable).toBe(true); }) @@ -114,10 +103,16 @@ test.describe('InstallationTypeTab', () => { installationTypePage.clickAgreeLicense() const is_GreenCheck_Visible = await installationTypePage.isLicenseAgreementGreenCheckVisible(); expect(is_GreenCheck_Visible).toBe(true); - const Is_Continue_Button_Enable = await installationTypePage.isContinueToComponentInstallationEnabled(); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); expect(Is_Continue_Button_Enable).toBe(true); await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) + await launch_Zen({page}) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + installationTypePage.clickInstallationTypeTab(); + await page.waitForTimeout(2000); expect(is_GreenCheck_Visible).toBe(true); expect(Is_Continue_Button_Enable).toBe(true); }) @@ -128,121 +123,17 @@ test.describe('InstallationTypeTab', () => { installationTypePage.clickDisagreeLicense() const is_GreenCheck_Visible = await installationTypePage.isLicenseAgreementGreenCheckVisible(); expect(is_GreenCheck_Visible).toBe(false); - const Is_Continue_Button_Enable = await installationTypePage.isContinueToComponentInstallationEnabled(); - expect(Is_Continue_Button_Enable).toBe(false); - await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) - expect(is_GreenCheck_Visible).toBe(false); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); expect(Is_Continue_Button_Enable).toBe(false); - }) - - test('Test Upload Zowe Pax', async ({ page }) => { - await page.waitForTimeout(5000) - installationTypePage.uploadZowePaxAndNavigateToInstallationPage(UPLOAD_PAX_PATH) - const Is_Continue_Button_Enable = await installationTypePage.isContinueToComponentInstallationEnabled(); - expect(Is_Continue_Button_Enable).toBe(true); - await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) - expect(Is_Continue_Button_Enable).toBe(true); - }) - - test('Test Installation Completed with Download Pax', async ({ page }) => { - await page.waitForTimeout(5000); - installationTypePage.downloadZowePaxAndNavigateToInstallationPage() - installationTypePage.clickContinueToInstallation() - await page.waitForTimeout(5000); - installationPage.enterPrefix(DATASET_PREFIX) - installationPage.enterProcLib(PROC_LIB) - installationPage.enterParmLib(PARM_LIB) - installationPage.enterZis(ZIS) - installationPage.enterJclLib(JCL_LIB) - installationPage.enterLoadLib(LOAD_LIB) - installationPage.enterAuthLoadLib(AUTH_LOAD_LIB) - installationPage.enterAuthPluginLib(AUTH_PLUGIN_LIB) - installationPage.clickInstallMvsDatasets(); - await page.waitForTimeout(1800000); - const is_Continue_Button_enable = await installationPage.isContinueToNetworkSetupEnabled(); - expect(is_Continue_Button_enable).toBe(true); - installationPage.clickContinueToNetworkSetup(); - await page.waitForTimeout(2000); - const networkSetup_title = await networkingPage.returnTitleOfNetworkingPage() - expect (networkSetup_title).toBe(NETWORKING_PAGE_TITLE); - await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) - installationTypePage.clickContinueToInstallation() - await page.waitForTimeout(2000); - expect(is_Continue_Button_enable).toBe(true); - }) - - test('Test Installation Completed with Upload Pax', async ({ page }) => { - await page.waitForTimeout(5000); - installationTypePage.uploadZowePaxAndNavigateToInstallationPage(UPLOAD_PAX_PATH) - installationTypePage.clickContinueToInstallation() - await page.waitForTimeout(5000); - installationPage.enterPrefix(DATASET_PREFIX) - installationPage.enterProcLib(PROC_LIB) - installationPage.enterParmLib(PARM_LIB) - installationPage.enterZis(ZIS) - installationPage.enterJclLib(JCL_LIB) - installationPage.enterLoadLib(LOAD_LIB) - installationPage.enterAuthLoadLib(AUTH_LOAD_LIB) - installationPage.enterAuthPluginLib(AUTH_PLUGIN_LIB) - installationPage.clickInstallMvsDatasets(); - await page.waitForTimeout(1800000); - const is_Continue_Button_enable = await installationPage.isContinueToNetworkSetupEnabled(); - expect(is_Continue_Button_enable).toBe(true); - installationPage.clickContinueToNetworkSetup(); - await page.waitForTimeout(2000); - const networkSetup_title = await networkingPage.returnTitleOfNetworkingPage() - expect (networkSetup_title).toBe(NETWORKING_PAGE_TITLE); - await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) - installationTypePage.clickContinueToInstallation() - await page.waitForTimeout(2000); - expect(is_Continue_Button_enable).toBe(true); - }) - - test('Test Installation Pending with Download Pax', async ({ page }) => { - await page.waitForTimeout(5000); - installationTypePage.downloadZowePaxAndNavigateToInstallationPage() - installationTypePage.clickContinueToInstallation() - await page.waitForTimeout(5000); - installationPage.enterPrefix(DATASET_PREFIX) - installationPage.enterProcLib(PROC_LIB) - installationPage.enterParmLib(PARM_LIB) - installationPage.enterZis(ZIS) - installationPage.enterJclLib(JCL_LIB) - installationPage.enterLoadLib(LOAD_LIB) - installationPage.enterAuthLoadLib(AUTH_LOAD_LIB) - installationPage.enterAuthPluginLib(AUTH_PLUGIN_LIB) - const is_Continue_Button_disable = await installationPage.isContinueToNetworkSetupDisabled(); - expect(is_Continue_Button_disable).toBe(true); await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) - installationTypePage.clickContinueToInstallation() + await launch_Zen({page}) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) await page.waitForTimeout(2000); - expect(is_Continue_Button_disable).toBe(true); - }) - - test('Test Installation Pending with Upload Pax', async ({ page }) => { - await page.waitForTimeout(5000); - installationTypePage.uploadZowePaxAndNavigateToInstallationPage(UPLOAD_PAX_PATH) - installationTypePage.clickContinueToInstallation() - await page.waitForTimeout(5000); - installationPage.enterPrefix(DATASET_PREFIX) - installationPage.enterProcLib(PROC_LIB) - installationPage.enterParmLib(PARM_LIB) - installationPage.enterZis(ZIS) - installationPage.enterJclLib(JCL_LIB) - installationPage.enterLoadLib(LOAD_LIB) - installationPage.enterAuthLoadLib(AUTH_LOAD_LIB) - installationPage.enterAuthPluginLib(AUTH_PLUGIN_LIB) - const is_Continue_Button_disable = await installationPage.isContinueToNetworkSetupDisabled(); - expect(is_Continue_Button_disable).toBe(true); - await electronApp.close() - await launch_Zen_and_Navigate_to_Installation_Type_Tab({page}) - installationTypePage.clickContinueToInstallation() + await connectionPage.SubmitValidateCredential(); + installationTypePage.clickInstallationTypeTab(); await page.waitForTimeout(2000); - expect(is_Continue_Button_disable).toBe(true); + expect(is_GreenCheck_Visible).toBe(false); + expect(Is_Continue_Button_Enable).toBe(false); }) }) \ No newline at end of file diff --git a/playwright_test/Tests/StateManagementPlanning.spec.ts b/playwright_test/Tests/StateManagementPlanning.spec.ts index b6bff4e..0a5e898 100644 --- a/playwright_test/Tests/StateManagementPlanning.spec.ts +++ b/playwright_test/Tests/StateManagementPlanning.spec.ts @@ -2,33 +2,19 @@ import { test, ElectronApplication, expect, _electron as electron, Page } from ' import ConnectionPage from '../Pages/connection.page.ts'; import TitlePage from '../Pages/title.page.ts'; import PlanningPage from '../Pages/planning.page.ts'; +import config from '../utils/config.ts'; let page: Page; let electronApp: ElectronApplication -const SSH_HOST = process.env.SSH_HOST; -const SSH_PASSWD = process.env.SSH_PASSWD; -const SSH_PORT = process.env.SSH_PORT; -const SSH_USER = process.env.SSH_USER; -const JOB_STATEMENT = "//ZWEJOB01 JOB IZUACCT,'SYSPROG',CLASS=A,\n// MSGLEVEL=(1,1),MSGCLASS=A" +const VALID_JOB_STATEMENT = "//ZWEJOB01 JOB IZUACCT,'SYSPROG',CLASS=A,\n// MSGLEVEL=(1,1),MSGCLASS=A"; const INVALID_JOB_STATEMENT = "//HELLOJOB JOB 'HELLO, WORLD!',CLASS=A,MSGCLASS"; -const RUNTIME_DIR = process.env.ZOWE_ROOT_DIR; -const WORKSPACE_DIR = process.env.ZOWE_WORKSPACE_DIR; -const LOG_DIR = process.env.ZOWE_LOG_DIR; -const EXTENSIONS_DIR = process.env.ZOWE_EXTENSION_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('State_Management_PlanningTab', () => { let connectionPage: ConnectionPage; let titlePage : TitlePage; let planningPage: PlanningPage; - async function launch_Zen_and_Navigate_to_Planning_Tab({ page }) { + async function launch_Zen({ page }) { test.setTimeout(900000); electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) page= await electronApp.firstWindow() @@ -36,79 +22,117 @@ test.describe('State_Management_PlanningTab', () => { titlePage = new TitlePage(page); planningPage = new PlanningPage(page); await page.waitForTimeout(5000) - titlePage.navigateToConnectionTab(); - connectionPage.fillConnectionDetails(SSH_HOST,SSH_PORT,SSH_USER,SSH_PASSWD) - await page.waitForTimeout(5000); - connectionPage.SubmitValidateCredential(); - await page.waitForTimeout(3000); - connectionPage.clickContinueButton(); - await page.waitForTimeout(5000); } test.beforeEach(async () => { - await launch_Zen_and_Navigate_to_Planning_Tab({page}) + await launch_Zen({page}) + titlePage.navigateToConnectionTab(); + await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); }) - + test.afterEach(async () => { await electronApp.close() }) test('Test Added Job Statement and Not Validated', async ({page}) => { planningPage.enterJobStatement(INVALID_JOB_STATEMENT); + await page.waitForTimeout(2000) + planningPage.clickSaveAndValidate(); await page.waitForTimeout(5000) const jobstatement = await planningPage.getJobStatement(); expect(jobstatement).toBe(INVALID_JOB_STATEMENT); const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); expect(isGreen_check_visible).toBe(false); await electronApp.close() - await launch_Zen_and_Navigate_to_Planning_Tab({page}) + await launch_Zen({page}) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); + await page.waitForTimeout(2000); expect(jobstatement).toBe(INVALID_JOB_STATEMENT); expect(isGreen_check_visible).toBe(false); }) - + test('Test Added Job Statement and Validated Successfully', async ({page}) => { - planningPage.enterJobStatement(JOB_STATEMENT); + planningPage.enterJobStatement(VALID_JOB_STATEMENT); + await page.waitForTimeout(2000) planningPage.clickSaveAndValidate(); - await page.waitForTimeout(30000); + await page.waitForTimeout(5000); const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); expect(isGreen_check_visible).toBe(true); await electronApp.close() - await launch_Zen_and_Navigate_to_Planning_Tab({page}) + await launch_Zen({page}) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); + await page.waitForTimeout(2000); expect(isGreen_check_visible).toBe(true); }) test('Test Locations Validated and Planning Step Completed', async ({page}) => { await page.waitForTimeout(2000); - planningPage.clickSaveValidate(); - await page.waitForTimeout(20000); - planningPage.fillPlanningPageWithRequiredFields(RUNTIME_DIR, WORKSPACE_DIR,EXTENSIONS_DIR,LOG_DIR,'1',JOB_NAME,JOB_PREFIX,JAVA_HOME,NODE_HOME,ZOSMF_HOST,ZOSMF_PORT,ZOSMF_APP_ID) - await page.waitForTimeout(30000); + await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, + config.ZOWE_WORKSPACE_DIR, + config.ZOWE_EXTENSION_DIR, + config.ZOWE_LOG_DIR, + config.JAVA_HOME, + config.NODE_HOME, + config.ZOSMF_HOST, + config.ZOSMF_PORT, + config.ZOSMF_APP_ID + ); + await page.waitForTimeout(2000); planningPage.clickValidateLocations() - await page.waitForTimeout(30000); + await page.waitForTimeout(5000); 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); await electronApp.close() - await launch_Zen_and_Navigate_to_Planning_Tab({page}) + await launch_Zen({page}) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); + await page.waitForTimeout(2000); expect(is_GreenCheck_Visible).toBe(true); expect(is_Continue_Button_enable).toBe(true); }) test('Test Locations Not Validated and Planning Step Pending', async ({page}) => { await page.waitForTimeout(2000) - planningPage.clickSaveValidate(); - await page.waitForTimeout(20000); - planningPage.fillPlanningPageWithRequiredFields(RUNTIME_DIR, WORKSPACE_DIR,EXTENSIONS_DIR,LOG_DIR,'1',JOB_NAME,JOB_PREFIX,JAVA_HOME,NODE_HOME,ZOSMF_HOST,ZOSMF_PORT,ZOSMF_APP_ID) - await page.waitForTimeout(30000); + await planningPage.fillPlanningPageWithRequiredFields(config.ZOWE_ROOT_DIR, + 'TESTABC', + config.ZOWE_EXTENSION_DIR, + config.ZOWE_LOG_DIR, + 'JAVA_HOME', + '12345', + config.ZOSMF_HOST, + config.ZOSMF_PORT, + config.ZOSMF_APP_ID + ); + await page.waitForTimeout(2000) planningPage.clickValidateLocations() - await page.waitForTimeout(30000); + await page.waitForTimeout(5000); 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); await electronApp.close() - await launch_Zen_and_Navigate_to_Planning_Tab({page}) + await launch_Zen({page}) + titlePage.clickOnResumeProgress(); + connectionPage.fillPassword(config.SSH_PASSWD) + await page.waitForTimeout(2000); + await connectionPage.SubmitValidateCredential(); + await connectionPage.clickContinueButton(); + await page.waitForTimeout(2000); expect(is_GreenCheck_Visible).toBe(false); expect(is_Continue_Button_enable).toBe(false); }) diff --git a/playwright_test/utils/config.ts b/playwright_test/utils/config.ts index 95e1457..5c9d65b 100644 --- a/playwright_test/utils/config.ts +++ b/playwright_test/utils/config.ts @@ -19,6 +19,7 @@ interface Config { AUTH_PLUGIN_LIB: string | undefined; PROC_LIB: string | undefined; PARM_LIB: string | undefined; + ZIS: string | undefined; JCL_LIB: string | undefined; LOAD_LIB: string | undefined; DOMAIN_NAME: string | undefined; @@ -58,6 +59,7 @@ const config: Config = { AUTH_PLUGIN_LIB: process.env.AUTH_PLUGIN_LIB, PROC_LIB: process.env.PROC_LIB, PARM_LIB: process.env.PARM_LIB, + ZIS: process.env.ZIS, JCL_LIB: process.env.JCL_LIB, LOAD_LIB: process.env.LOAD_LIB, EXTERNAL_PORT: process.env.EXTERNAL_PORT,