diff --git a/playwright_test/Pages/installationType.page.ts b/playwright_test/Pages/installationType.page.ts index 010a8335..00a9f8c3 100644 --- a/playwright_test/Pages/installationType.page.ts +++ b/playwright_test/Pages/installationType.page.ts @@ -1,6 +1,6 @@ -import { Page,Locator } from '@playwright/test'; +import { Page, Locator } from '@playwright/test'; -class InstallationTypePage{ +class InstallationTypePage { page: Page; pageTitle: Locator; downloadPax: Locator; @@ -17,7 +17,15 @@ class InstallationTypePage{ validateLocation: Locator; validateLocationGreenCheck: Locator; licenseAgreementGreenCheck: Locator; - + disagreeLicense: Locator; + installation_Type_Tab: Locator; + continueToUnpaxButton: Locator; + installationPageTitle: Locator; + retrieveExampleZoweYaml: Locator; + continueCompInstallation: Locator; + skipUnpaxButton: Locator; + SkipUnpax: Locator; + click_InitializationStage: Locator; constructor(page: Page) { this.page = page; @@ -27,69 +35,85 @@ 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']") this.agreeLicense = 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']") this.validateLocationGreenCheck = page.locator("//button[text()='Validate location']//following-sibling::*[@data-testid='CheckCircleIcon']") this.licenseAgreementGreenCheck = page.locator("//button[text()='License Agreement']//following-sibling::*[@data-testid='CheckCircleIcon']") - 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.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.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.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(){ + async getInstallationTypePageTitle() { return await this.pageTitle.textContent({ timeout: 2000 }); } - async selectDownloadZowePax(){ - await this.downloadPax.click({timeout: 5000}) + async selectDownloadZowePax() { + await this.downloadPax.click({ timeout: 5000 }) } - async selectUploadZowePax(){ - await this.uploadPax.click({timeout: 5000}); + async isDownloadZowePaxSelected() { + await this.page.waitForTimeout(1000) + return await this.downloadPax.isChecked() } - async selectSmpe(){ - await this.smpe.click({timeout: 5000}); + async selectUploadZowePax() { + await this.uploadPax.click({ timeout: 5000 }); } - async continueToUnpax(){ - await this.continueToUnpax.click({ timeout: 2000 }) + async isUploadZowePaxSelected() { + await this.page.waitForTimeout(1000) + return await this.uploadPax.isChecked() } - async retrieveExampleYaml(){ - await this.retrieveExampleZoweYaml.click({timeout: 5000}); + async selectSmpe() { + await this.smpe.click({ timeout: 5000 }); } - async continueComponentInstallation(){ + async continueToUnpax() { + await this.continueToUnpaxButton.click({ timeout: 2000 }) + } + + async retrieveExampleYaml() { + await this.retrieveExampleZoweYaml.click({ timeout: 5000 }); + } + + async continueComponentInstallation() { const timeout = 5000; - const interval = 500; - while (true) { - if (await this.continueCompInstallation.isEnabled()) { - await this.continueCompInstallation.click(); - return; + const interval = 500; + while (true) { + if (await this.continueCompInstallation.isEnabled()) { + await this.continueCompInstallation.click(); + return; } await this.page.waitForTimeout(interval); } - await this.continueCompInstallation.click({timeout: timeout}); + await this.continueCompInstallation.click({ timeout: timeout }); } private async waitForInstallationPageVisible(): Promise { - const timeout = 1000000; - const interval = 500; + const timeout = 1000000; + const interval = 500; const endTime = Date.now() + timeout; while (Date.now() < endTime) { if (await this.installationPageTitle.isVisible()) { - return; + return; } await this.page.waitForTimeout(interval); } @@ -97,100 +121,110 @@ class InstallationTypePage{ throw new Error('Timed out waiting for the Installation Page to become visible.'); } - async clickZoweLink(){ + async isSmpeSelected() { + await this.page.waitForTimeout(1000) + return await this.smpe.isChecked() + } + + async clickZoweLink() { await this.zoweLink.click(); } - async clickLicenseAgreement(){ - await this.licenseAgreement.click({timeout: 5000}); + async clickLicenseAgreement() { + await this.licenseAgreement.click({ timeout: 5000 }); } - async clickSaveAndClose(){ - await this.saveAndClose.click({timeout: 5000}); + async clickSaveAndClose() { + await this.saveAndClose.click({ timeout: 5000 }); } - async clickPreviousStep(){ + async clickPreviousStep() { await this.previousStep.click(); } - async clickContinueToInstallation(){ + async clickContinueToInstallation() { await this.continueToComponentInstallation.click(); } - async isContinueToComponentInstallationDisabled(){ + async isContinueToComponentInstallationDisabled() { return await this.continueToComponentInstallation.isDisabled() } - async isContinueToComponentInstallationEnabled(){ + async isContinueToComponentInstallationEnabled() { return await this.continueToComponentInstallation.isEnabled() } - async isContinueUnpaxEnabled(){ - return await this.continueToUnpax.isEnabled() + async clickAgreeLicense() { + await this.agreeLicense.click({ timeout: 5000 }); } - async clickAgreeLicense(){ - await this.agreeLicense.click({timeout: 5000}); + async clickDisagreeLicense() { + await this.page.waitForTimeout(1000) + await this.disagreeLicense.click({ timeout: 5000 }); } - async isLicenseAgreementGreenCheckVisible(){ + async isLicenseAgreementGreenCheckVisible() { await this.page.waitForTimeout(5000); - return await this.licenseAgreementGreenCheck.isVisible({timeout: 5000}); + return await this.licenseAgreementGreenCheck.isVisible({ timeout: 5000 }); } - async clickUploadPaxButton(){ - await this.uploadPaxButton.click({timeout: 5000}); + async clickUploadPaxButton() { + await this.uploadPaxButton.click({ timeout: 5000 }); } - async skipUnpax(){ - await this.skipUnpaxButton.click({timeout: 5000}); + async skipUnpax() { + await this.skipUnpaxButton.click({ timeout: 5000 }); await this.waitForInstallationPageVisible(); } - async enterRuntimeDir(runtimeDir: any){ - await this.runtimeDir.clear({timeout: 5000}) + async enterRuntimeDir(runtimeDir: any) { + await this.runtimeDir.clear({ timeout: 5000 }) await this.runtimeDir.fill(runtimeDir); } - async clickValidateLocation(){ - await this.validateLocation.click({timeout: 5000}); + async clickValidateLocation() { + await this.validateLocation.click({ timeout: 5000 }); } - async isValidateLocationGreenCheckVisible(){ + async isValidateLocationGreenCheckVisible() { return await this.validateLocationGreenCheck.isVisible(); } - async downloadZowePaxAndNavigateToInstallationPage(){ + async downloadZowePaxAndNavigateToInstallationPage() { await this.selectDownloadZowePax() await this.clickLicenseAgreement() await this.clickAgreeLicense() } - async uploadZowePaxAndNavigateToInstallationPage(uploadPaxPath: any){ + async uploadZowePaxAndNavigateToInstallationPage(uploadPaxPath: any) { this.selectUploadZowePax() await this.uploadPaxButton.setInputFiles(uploadPaxPath) } - async smpeZowePaxAndNavigateToInstallationPage(runtimeDir: any){ + async smpeZowePaxAndNavigateToInstallationPage(runtimeDir: any) { this.selectSmpe() this.enterRuntimeDir(runtimeDir) this.clickValidateLocation() } - async clickOnContinueToUnpax(){ - this.continueToUnpax.click({ timeout: 2000 }) + async clickOnContinueToUnpax() { + this.continueToUnpaxButton.click({ timeout: 2000 }) + } + + async isContinueToUnpaxEnabled() { + return await this.continueToUnpaxButton.isEnabled() } - async clickSkipUnpaxButton(){ + async clickSkipUnpaxButton() { this.SkipUnpax.click({ timeout: 2000 }) } - async clickRetrieveExZoweYaml(){ + async clickRetrieveExZoweYaml() { this.retrieveExampleZoweYaml.click({ timeout: 15000 }) } - async MoveToInitializationStage(){ + async MoveToInitializationStage() { this.click_InitializationStage.click({ timeout: 15000 }) } } - export default InstallationTypePage; +export default InstallationTypePage; diff --git a/playwright_test/Pages/planning.page.ts b/playwright_test/Pages/planning.page.ts index 658f20c1..01b72dec 100644 --- a/playwright_test/Pages/planning.page.ts +++ b/playwright_test/Pages/planning.page.ts @@ -1,7 +1,6 @@ import { Locator, Page } from '@playwright/test'; -let page: Page; -class PlanningPage{ +class PlanningPage { page: Page; planningPageTitle: Locator; zoweInstallationLink: Locator; @@ -12,13 +11,8 @@ class PlanningPage{ workspaceDir: Locator; logsDir: Locator; extensionsDir: Locator; - rbacProfileIdentifier: Locator; - jobName: Locator; - jobPrefix: Locator; - cookieIdentifier: Locator; javaLocation: Locator; nodeJsLocation: Locator; - setZosmf: Locator; zosmfHost: Locator; zosmfPort: Locator; zosmfApplicationId: Locator; @@ -29,6 +23,7 @@ class PlanningPage{ continueInstallationOptions: Locator; readyToProceedMessage: Locator; errorMessage: Locator; + save_and_close: Locator; constructor(page: Page) { this.page = page; @@ -41,16 +36,10 @@ class PlanningPage{ this.workspaceDir = page.locator("//label[contains(text(),'Workspace Directory')]//following-sibling::div/input") this.logsDir = page.locator("//label[contains(text(),'Log Directory')]//following-sibling::div/input") this.extensionsDir = page.locator("//label[contains(text(),'Extensions Directory')]//following-sibling::div/input") - this.rbacProfileIdentifier = page.locator("//label[contains(text(),'Rbac Profile Identifier')]//following-sibling::div/input") - this.jobName = page.locator("//label[contains(text(),'Job Name')]//following-sibling::div/input") - this.jobPrefix = page.locator("//label[contains(text(),'Job Prefix')]//following-sibling::div/input") - this.cookieIdentifier = page.locator("//label[contains(text(),'Cookie Identifier')]//following-sibling::div/input") this.javaLocation = page.locator("//label[contains(text(),'Java Home Directory')]//following-sibling::div/input") this.nodeJsLocation = page.locator("//label[contains(text(),'Node.js Home Directory')]//following-sibling::div/input") - this.setZosmf = page.locator("//span[text()='Set z/OSMF Attributes (optional)']/preceding-sibling::span/input") this.zosmfHost = page.locator("//label[contains(text(),'z/OSMF Host')]//following-sibling::div/input") this.zosmfPort = page.locator('//label[contains(text(), "z/OSMF Port")]/following-sibling::div/input[@id="zosmf-port"]') - //this.zosmfPort = page.locator('//input[@id="zosmf-port"]'); this.zosmfApplicationId = page.locator("//label[contains(text(),'z/OSMF Application Id')]//following-sibling::div/input") this.validateLocations = page.locator("//button[contains(text(), 'Validate locations')]") this.ValidateLocationsGreenCheck = page.locator("//button[text()='Validate locations']//following-sibling::*[@data-testid='CheckCircleIcon']") @@ -58,30 +47,35 @@ 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(){ + async clickZoweInstallationLink() { await this.page.waitForTimeout(500); await this.zoweInstallationLink.click(); } - async getPlanningPageTitle(){ + async getPlanningPageTitle() { await this.page.waitForTimeout(1000); return await this.planningPageTitle.textContent(); } - async click_saveAndClose(){ + async getJobStatement() { + await this.page.waitForTimeout(1000); + return await this.jobStatement.textContent(); + } + + async click_saveAndClose() { await this.page.waitForTimeout(5000); await this.save_and_close.click({ timeout: 2000 }) } - async enterJobStatement(jobStatement: string){ + async enterJobStatement(jobStatement: string) { await this.page.waitForTimeout(500); await this.jobStatement.fill(jobStatement); } - async clickSaveAndValidate(){ + async clickSaveAndValidate() { await this.saveAndValidate.click({ timeout: 5000 }); } @@ -96,110 +90,71 @@ class PlanningPage{ } } - async getErrorMessage(){ + async getErrorMessage() { await this.page.waitForTimeout(1000); return await this.errorMessage.textContent(); } - async enterRuntimeDir(runtimeDir: any){ + async enterRuntimeDir(runtimeDir: any) { await this.page.waitForTimeout(500); - //await this.runtimeDir.clear({timeout: 2000}) await this.runtimeDir.fill(runtimeDir); } - async getrRuntimeDir(){ - const value = await this.runtimeDir.inputValue(); - return value; + async getrRuntimeDir() { + const value = await this.runtimeDir.inputValue(); + return value; } - async enterWorkspaceDir(workspaceDir: any){ + async enterWorkspaceDir(workspaceDir: any) { await this.page.waitForTimeout(500); - await this.workspaceDir.clear({timeout: 2000}) + await this.workspaceDir.clear({ timeout: 2000 }) await this.workspaceDir.fill(workspaceDir); } - async enterLogsDir(logsDir: any){ + async enterLogsDir(logsDir: any) { await this.page.waitForTimeout(500); - await this.logsDir.clear({timeout: 2000}) + await this.logsDir.clear({ timeout: 2000 }) await this.logsDir.fill(logsDir); } - async enterExtensionsDir(extensionsDir: any){ + async enterExtensionsDir(extensionsDir: any) { await this.page.waitForTimeout(500); - await this.extensionsDir.clear({timeout: 2000}) + await this.extensionsDir.clear({ timeout: 2000 }) await this.extensionsDir.fill(extensionsDir); } - async enterRbacProfileIdentifier(rbacProfileIdentifier: any){ - await this.page.waitForTimeout(500); - await this.rbacProfileIdentifier.clear({timeout: 2000}) - await this.rbacProfileIdentifier.fill(rbacProfileIdentifier); - } - - async enterJobName(jobName: any){ - await this.page.waitForTimeout(500); - await this.jobName.clear({timeout: 2000}) - await this.jobName.fill(jobName); - } - - async enterJobPrefix(jobPrefix: any){ - await this.page.waitForTimeout(500); - await this.jobPrefix.clear({timeout: 2000}) - await this.jobPrefix.fill(jobPrefix); - } - - async enterCookieIdentifier(cookieIdentifier: any){ - await this.page.waitForTimeout(500); - await this.cookieIdentifier.clear({timeout: 2000}) - await this.cookieIdentifier.fill(cookieIdentifier); - } - - async enterJavaLocation(javaLocation: any){ + async enterJavaLocation(javaLocation: any) { await this.page.waitForTimeout(500); - await this.javaLocation.clear({timeout: 2000}) + await this.javaLocation.clear({ timeout: 2000 }) await this.javaLocation.fill(javaLocation); } - async enterNodeJsLocation(nodeJsLocation: any){ + async enterNodeJsLocation(nodeJsLocation: any) { await this.page.waitForTimeout(500); - await this.nodeJsLocation.clear({timeout: 2000}) + await this.nodeJsLocation.clear({ timeout: 2000 }) await this.nodeJsLocation.fill(nodeJsLocation); } - async isSetZosmfAttributeChecked(){ - await this.page.waitForTimeout(1000); - return await this.setZosmf.isChecked(); - } - - async checkSetZosmfAttribute(){ - await this.page.waitForTimeout(1000); - if (await this.isSetZosmfAttributeChecked() == false){ - await this.setZosmf.click(); - } - - } - - async enterZosmfHost(zosmfHost: any){ + async enterZosmfHost(zosmfHost: any) { await this.page.waitForTimeout(500); - await this.zosmfHost.clear({timeout: 2000}) + await this.zosmfHost.clear({ timeout: 2000 }) await this.zosmfHost.fill(zosmfHost); } - async enterZosmfPort(zosmfPort: any){ + async enterZosmfPort(zosmfPort: any) { await this.page.waitForTimeout(500); - await this.zosmfPort.clear({timeout: 2000}) + await this.zosmfPort.clear({ timeout: 2000 }) await this.zosmfPort.fill(zosmfPort); } - async enterZosmfApplicationId(zosmfApplicationId: any){ + async enterZosmfApplicationId(zosmfApplicationId: any) { await this.page.waitForTimeout(500); - await this.zosmfApplicationId.clear({timeout: 2000}) + await this.zosmfApplicationId.clear({ timeout: 2000 }) await this.zosmfApplicationId.fill(zosmfApplicationId); } - async clickValidateLocations(){ - await this.validateLocations.click({timeout: 5000}); - await this.waitForContinueButtonToBeEnabled(); + async clickValidateLocations() { + await this.validateLocations.click({ timeout: 5000 }); } async isValidateLocationsGreenCheckVisible(): Promise { @@ -212,60 +167,70 @@ class PlanningPage{ } } - - async clickSaveAndClose(){ + async clickSaveAndClose() { await this.page.waitForTimeout(5000); await this.save_and_close.click({ timeout: 5000 }) } - async clickPreviousStep(){ + async clickPreviousStep() { await this.page.waitForTimeout(500); await this.previousStep.click(); } - async clickContinueToInstallation(){ + 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; const startTime = Date.now(); - const isButtonEnabled = async (): Promise => { + const isButtonEnabled = async (): Promise => { return await this.isContinueToInstallationEnabled(); }; - while (!(await isButtonEnabled())) { + while (!(await isButtonEnabled())) { if (Date.now() - startTime > timeout) { throw new Error('Timed out waiting for the button to be enabled.'); } await new Promise(resolve => setTimeout(resolve, interval)); } await this.continueInstallationOptions.click(); -} + } - async isContinueToInstallationDisabled(){ + async isContinueToInstallationDisabled() { await this.page.waitForTimeout(500); return await this.continueInstallationOptions.isDisabled() } - async isContinueToInstallationEnabled(){ + async isContinueToInstallationEnabled() { await this.page.waitForTimeout(500); return await this.continueInstallationOptions.isEnabled() } - async getReadyToProceedMessage(){ + async getReadyToProceedMessage() { await this.page.waitForTimeout(1000); return await this.readyToProceedMessage.textContent({ timeout: 2000 }); } - async isContinueToInstallationDisabled(){ - await this.page.waitForTimeout(500); - return await this.continueInstallationOptions.isDisabled() - } - - async clickSaveValidate(){ + async clickSaveValidate() { await this.jobStatement.fill("//ZWEJOB01 JOB IZUACCT,'SYSPROG',CLASS=A,\n// MSGLEVEL=(1,1),MSGCLASS=A") await this.saveAndValidate.click(); - await this.page.waitForTimeout(500); + await this.page.waitForTimeout(2000); } - - async fillPlanningPageWithRequiredFields(runtimeDir: any, workspaceDir: any, extensionDir: any, logDir: 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); @@ -278,6 +243,5 @@ class PlanningPage{ await this.enterZosmfApplicationId(zOSMFAppID); await this.page.waitForTimeout(2000); } - } - export default PlanningPage; +export default PlanningPage; diff --git a/playwright_test/Tests/InstallationType.spec.ts b/playwright_test/Tests/InstallationType.spec.ts index 6bae3d29..6113f063 100644 --- a/playwright_test/Tests/InstallationType.spec.ts +++ b/playwright_test/Tests/InstallationType.spec.ts @@ -7,10 +7,8 @@ import InstallationPage from '../Pages/installation.page.ts'; import config from '../utils/config'; import { prepareEnvironment } from '../prepare.js'; - let electronApp: ElectronApplication const PLANNING_TITLE = 'Before you start'; -const INSTALLATION_PAGE_TITLE = 'Installation'; const DOWNLOAD_ZOWE_PAX = 'Download Zowe Pax'; test.beforeAll(async () => { @@ -25,12 +23,12 @@ test.beforeAll(async () => { 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 }) => { + async function launch_Zen({ page }) { test.setTimeout(900000); electronApp = await electron.launch({ args: ['.webpack/main/index.js'] }) page = await electronApp.firstWindow() @@ -39,20 +37,25 @@ test.describe('InstallationTypeTab', () => { planningPage = new PlanningPage(page); installationTypePage = new InstallationTypePage(page); installationPage = new InstallationPage(page); - await titlePage.navigateToConnectionTab() + await page.waitForTimeout(5000) + } + + test.beforeEach(async ({ 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 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() }) @@ -69,7 +72,7 @@ test.describe('InstallationTypeTab', () => { expect(installationTypePage.saveAndClose).toBeTruthy() expect(installationTypePage.previousStep).toBeTruthy() expect(installationTypePage.continueToComponentInstallation).toBeTruthy() - const is_continue_button_enabled = await installationTypePage.isContinueUnpaxEnabled(); + const is_continue_button_enabled = await installationTypePage.isContinueToUnpaxEnabled(); expect(is_continue_button_enabled).toBe(false); }) @@ -79,20 +82,20 @@ test.describe('InstallationTypeTab', () => { await installationTypePage.clickAgreeLicense() const is_GreenCheck_Visible = await installationTypePage.isLicenseAgreementGreenCheckVisible(); expect(is_GreenCheck_Visible).toBe(true); - const is_continue_button_enabled = await installationTypePage.isContinueUnpaxEnabled(); + const is_continue_button_enabled = await installationTypePage.isContinueToUnpaxEnabled(); expect(is_continue_button_enabled).toBe(true); }) /* Need to figure out new logic test('Test Upload Zowe Pax', async ({ page }) => { await installationTypePage.uploadZowePaxAndNavigateToInstallationPage(UPLOAD_PAX_PATH) - const Is_Continue_Button_Enable = await installationTypePage.isContinueUnpaxEnabled(); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); expect(Is_Continue_Button_Enable).toBe(true); - })*/ + })*/ test('Test SMPE ', async ({ page }) => { await installationTypePage.selectSmpe() - const Is_Continue_Button_Enable = await installationTypePage.isContinueUnpaxEnabled(); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); expect(Is_Continue_Button_Enable).toBe(true); }) @@ -106,26 +109,114 @@ test.describe('InstallationTypeTab', () => { await installationTypePage.selectDownloadZowePax() await installationTypePage.clickLicenseAgreement() await installationTypePage.clickAgreeLicense() - const Is_Continue_Button_Enable = await installationTypePage.isContinueUnpaxEnabled(); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); expect(Is_Continue_Button_Enable).toBe(true); await installationTypePage.clickOnContinueToUnpax() const title = await installationPage.getInstallationPageTitle(); expect(title).toBe(DOWNLOAD_ZOWE_PAX); }) - test('Test Save and Close and Resume Progress', async ({page}) => { + test('Test Save and Close and Resume Progress', async ({ page }) => { await installationTypePage.selectDownloadZowePax() await installationTypePage.clickLicenseAgreement() await installationTypePage.clickAgreeLicense() - const Is_Continue_Button_Enable = await installationTypePage.isContinueUnpaxEnabled(); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); expect(Is_Continue_Button_Enable).toBe(true); await installationTypePage.clickSaveAndClose(); await titlePage.clickOnResumeProgress(); - await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); + await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); await connectionPage.SubmitValidateCredential() const is_GreenCheck_Visible = await installationTypePage.isLicenseAgreementGreenCheckVisible(); expect(is_GreenCheck_Visible).toBe(true); - const Is_Continue_Button_Enable_After_Save = await installationTypePage.isContinueUnpaxEnabled(); + const Is_Continue_Button_Enable_After_Save = await installationTypePage.isContinueToUnpaxEnabled(); expect(Is_Continue_Button_Enable_After_Save).toBe(true); - }) + }) + + test('Test Select Downlad Zowe Pax', async ({ page }) => { + installationTypePage.selectDownloadZowePax() + const is_Download_Zowe_Pax_Selected = await installationTypePage.isDownloadZowePaxSelected(); + expect(is_Download_Zowe_Pax_Selected).toBe(true); + await electronApp.close() + 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); + }) + + test('Test Select Upload Zowe Pax', async ({ page }) => { + installationTypePage.selectUploadZowePax() + const is_Upload_Zowe_Pax_Selected = await installationTypePage.isUploadZowePaxSelected(); + expect(is_Upload_Zowe_Pax_Selected).toBe(true); + await electronApp.close() + 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); + }) + + test('Test Select SMPE', async ({ page }) => { + installationTypePage.selectSmpe(); + const is_SMPE_Selected = await installationTypePage.isSmpeSelected(); + expect(is_SMPE_Selected).toBe(true); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); + expect(Is_Continue_Button_Enable).toBe(true); + await electronApp.close() + 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); + }) + + test('Test Agree License Agreement', async ({ page }) => { + installationTypePage.selectDownloadZowePax() + installationTypePage.clickLicenseAgreement() + installationTypePage.clickAgreeLicense() + const is_GreenCheck_Visible = await installationTypePage.isLicenseAgreementGreenCheckVisible(); + expect(is_GreenCheck_Visible).toBe(true); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); + expect(Is_Continue_Button_Enable).toBe(true); + await electronApp.close() + 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); + }) + + test('Test Disagree License Agreement', async ({ page }) => { + installationTypePage.selectDownloadZowePax() + installationTypePage.clickLicenseAgreement() + installationTypePage.clickDisagreeLicense() + const is_GreenCheck_Visible = await installationTypePage.isLicenseAgreementGreenCheckVisible(); + expect(is_GreenCheck_Visible).toBe(false); + const Is_Continue_Button_Enable = await installationTypePage.isContinueToUnpaxEnabled(); + expect(Is_Continue_Button_Enable).toBe(false); + await electronApp.close() + 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(false); + expect(Is_Continue_Button_Enable).toBe(false); + }) }) diff --git a/playwright_test/Tests/Planning.spec.ts b/playwright_test/Tests/Planning.spec.ts index 5007d065..3d920ed6 100644 --- a/playwright_test/Tests/Planning.spec.ts +++ b/playwright_test/Tests/Planning.spec.ts @@ -1,153 +1,256 @@ -import { test, ElectronApplication, expect, _electron as electron, Page } from '@playwright/test'; +import { test, ElectronApplication, expect, _electron as electron } from '@playwright/test'; 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; import config from '../utils/config'; let electronApp: ElectronApplication -const CONNECTION_PAGE_TITLE = 'Connection'; const PLANNING_TITLE = 'Before you start'; const INSTALLATION_TYPE_TITLE = 'Installation Type'; const INVALID_JOB_STATEMENT = "//HELLOJOB JOB 'HELLO, WORLD!',CLASS=A,MSGCLASS"; const ERROR_MESSAGE = `Failed to verify job statement STMT NO. MESSAGE\r\n 1 IEFC006I POSITIONAL PARAMETERS MUST BE SPECIFIED BEFORE KEYWORD PARAMETERS`; const EMPTY_ERROR = "Error invoking remote method 'get-env-vars': Error: Failed to submit jcl, job id not found"; const INVALID_INPUT_ERROR = 'Test/DIR is not a valid z/OS Unix path' +const VALID_JOB_STATEMENT = "//ZWEJOB01 JOB IZUACCT,'SYSPROG',CLASS=A,\n// MSGLEVEL=(1,1),MSGCLASS=A"; test.describe('PlanningTab', () => { - 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(); - 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 Valid Job Statement and Save Validate', async () => { - await planningPage.clickSaveValidate(); - const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); - expect(isGreen_check_visible).toBe(true); - }) - - test('Test Invalid Job Statement and Save Validate', async () => { - await planningPage.enterJobStatement(INVALID_JOB_STATEMENT); - await planningPage.clickSaveAndValidate(); - const error_Message = await planningPage.getErrorMessage() - expect (error_Message.trim()).toBe(ERROR_MESSAGE.trim()); - const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); - expect(isGreen_check_visible).toBe(false); - }) - - test('Test Empty Job Statement and Save Validate', async () => { - await planningPage.enterJobStatement(''); - await planningPage.clickSaveAndValidate(); - await page.waitForTimeout(20000); - const error_Message = await planningPage.getErrorMessage() - expect (error_Message).toBe(EMPTY_ERROR); - 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 () => { - await planningPage.clickSaveValidate(); - 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.save_and_close).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 Validate Locations with Valid Data', async () => { - 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() - 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 planningPage.clickContinueToInstallation(); - const installationType_title = await installationTypePage.getInstallationTypePageTitle() - expect (installationType_title).toBe(INSTALLATION_TYPE_TITLE); - }) - - test('Test Validate Locations with Invalid Data', async () => { - await planningPage.clickSaveValidate(); - await planningPage.enterRuntimeDir('Test/DIR'); - await planningPage.enterWorkspaceDir('Workspace Dir'); - await planningPage.enterLogsDir(config.ZOWE_LOG_DIR); - await planningPage.enterExtensionsDir(config.ZOWE_EXTENSION_DIR); - await planningPage.enterJavaLocation('/'); - await planningPage.enterNodeJsLocation(config.NODE_HOME); - await planningPage.enterZosmfApplicationId('ABCDDDETT'); - await planningPage.clickValidateLocations(); - const error_Message = await planningPage.getErrorMessage() - expect (error_Message).toBe(INVALID_INPUT_ERROR); - 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, - 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.click_saveAndClose() - await titlePage.clickOnResumeProgress(); - await connectionPage.fillConnectionDetails(config.SSH_HOST, config.SSH_PORT, config.SSH_USER, config.SSH_PASSWD); - await connectionPage.SubmitValidateCredential(); - 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); - }) + let connectionPage: ConnectionPage; + let titlePage: TitlePage; + let planningPage: PlanningPage; + let installationTypePage: InstallationTypePage + + async function launch_Zen({ 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); + await page.waitForTimeout(5000) + } + + test.beforeEach(async ({ 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 Valid Job Statement and Save Validate', async ({ page }) => { + await planningPage.clickSaveValidate(); + await page.waitForTimeout(5000) + const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); + expect(isGreen_check_visible).toBe(true); + }) + + test('Test Invalid Job Statement and Save Validate', async () => { + await planningPage.enterJobStatement(INVALID_JOB_STATEMENT); + await planningPage.clickSaveAndValidate(); + const error_Message = await planningPage.getErrorMessage() + expect(error_Message.trim()).toBe(ERROR_MESSAGE.trim()); + const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); + expect(isGreen_check_visible).toBe(false); + }) + + test('Test Empty Job Statement and Save Validate', async () => { + await planningPage.enterJobStatement(''); + await planningPage.clickSaveAndValidate(); + const error_Message = await planningPage.getErrorMessage() + expect(error_Message).toBe(EMPTY_ERROR); + 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 () => { + await planningPage.clickSaveValidate(); + expect(planningPage.runtimeDir).toBeTruthy(); + expect(planningPage.workspaceDir).toBeTruthy(); + expect(planningPage.logsDir).toBeTruthy(); + expect(planningPage.extensionsDir).toBeTruthy(); + expect(planningPage.javaLocation).toBeTruthy(); + expect(planningPage.nodeJsLocation).toBeTruthy(); + expect(planningPage.zosmfHost).toBeTruthy(); + expect(planningPage.zosmfPort).toBeTruthy(); + expect(planningPage.zosmfApplicationId).toBeTruthy(); + expect(planningPage.validateLocations).toBeTruthy(); + expect(planningPage.save_and_close).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 Validate Locations with Valid Data', async ({ page }) => { + 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.waitForContinueButtonToBeEnabled(); + 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 planningPage.clickContinueToInstallation(); + const installationType_title = await installationTypePage.getInstallationTypePageTitle() + expect(installationType_title).toBe(INSTALLATION_TYPE_TITLE); + }) + + test('Test Validate Locations with Invalid Data', async () => { + await planningPage.clickSaveValidate(); + await planningPage.enterRuntimeDir('Test/DIR'); + await planningPage.enterWorkspaceDir('Workspace Dir'); + await planningPage.enterLogsDir(config.ZOWE_LOG_DIR); + await planningPage.enterExtensionsDir(config.ZOWE_EXTENSION_DIR); + await planningPage.enterJavaLocation('/'); + await planningPage.enterNodeJsLocation(config.NODE_HOME); + await planningPage.enterZosmfApplicationId('ABCDDDETT'); + await planningPage.clickValidateLocations(); + const error_Message = await planningPage.getErrorMessage() + expect(error_Message).toBe(INVALID_INPUT_ERROR); + const is_Continue_Button_enable = await planningPage.isContinueToInstallationDisabled(); + expect(is_Continue_Button_enable).toBe(true); + }) + + test('Test Save and Close and Resume Progress', async ({ page }) => { + 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.waitForContinueButtonToBeEnabled(); + await page.waitForTimeout(5000); + await planningPage.click_saveAndClose() + await titlePage.clickOnResumeProgress(); + await connectionPage.fillPassword(config.SSH_PASSWD); + await connectionPage.SubmitValidateCredential(); + 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 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({ 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(VALID_JOB_STATEMENT); + await page.waitForTimeout(2000) + planningPage.clickSaveAndValidate(); + await page.waitForTimeout(5000); + const isGreen_check_visible = await planningPage.isSaveAndValidateGreenCheckVisible(); + expect(isGreen_check_visible).toBe(true); + await electronApp.close() + 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); + 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() + planningPage.waitForContinueButtonToBeEnabled(); + 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({ 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) + 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(5000); + const is_GreenCheck_Visible = await planningPage.isValidateLocationsGreenCheckVisible(); + expect(is_GreenCheck_Visible).toBe(false); + const is_Continue_Button_disable = await planningPage.isContinueToInstallationDisabled(); + expect(is_Continue_Button_disable).toBe(true); + await electronApp.close() + 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_disable).toBe(true); }) +}) diff --git a/playwright_test/utils/config.ts b/playwright_test/utils/config.ts index 95e14579..5c9d65bf 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,