Skip to content

Commit

Permalink
Merge pull request #238 from zowe/users/jstruga/zen-update
Browse files Browse the repository at this point in the history
Fix broken github action and improve test logic
  • Loading branch information
struga0258 authored Aug 14, 2024
2 parents 39b668d + a56869b commit 8dd3f1b
Show file tree
Hide file tree
Showing 17 changed files with 750 additions and 925 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,20 @@ jobs:
- build-macos
if: ${{ success() && github.event.inputs.PERFORM_RELEASE == 'true' }}
steps:
- name: '[Prep 3] Checkout'
- name: 'Checkout'
uses: actions/checkout@v3

- name: 'Set tag value'
run: |
COMMIT_HASH=$(git rev-parse --verify HEAD)
CURRENT_TIME=$(date +%s%3N)
if [ -z ${{ github.event.pull_request.number }} ]
then
CURRENT_BRANCH=${GITHUB_REF#refs/heads/}
else
CURRENT_BRANCH=PR-${{ github.event.pull_request.number }}
fi
P_VERSION=$(cat package.json | grep -o '"version": *"[^"]*"' | sed 's/"version": "\(.*\)"/\1/')
- name: '[Release 1] Release (if necessary)'
if: ${{ success() && github.event.inputs.PERFORM_RELEASE == 'true' }}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"author": "Zowe",
"description": "Zowe Server Install Wizard",
"productName": "zowe-install-wizard",
"version": "1.0.0",
"version": "1.0.1",
"main": ".webpack/main",
"scripts": {
"start": "electron-forge start --enable-logging",
Expand Down
10 changes: 10 additions & 0 deletions playwright_test/Pages/apfAuth.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ class ApfAuthPage{
this.dataset_prefix_value = page.getByLabel('Dataset Prefix')
this.auth_load_lib_value = page.getByLabel('APF Authorized Load Library')
this.auth_plugin_lib_value = page.getByLabel('Zowe ZIS Plugins Load Library')

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

}
async returnTitleOfApfAuthPage(){
Expand All @@ -93,6 +96,13 @@ class ApfAuthPage{
async movetoApfAuthPage(){
await this.click_ApfAuth.click({timeout: 9000})
}

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

async movetoInstallationPage(){
await this.licenseAgreement.click({timeout: 9000})
await this.acceptLicense.click({timeout: 9000})
Expand Down
19 changes: 8 additions & 11 deletions playwright_test/Pages/connection.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,17 @@ class ConnectionPage{
this.resumeProgress = page.locator('//button[contains(text(),"Resume Progress")]')
this.continueButton = page.locator('.MuiButton-containedPrimary.MuiButton-sizeMedium')
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);
await this.host.fill(host)
console.log("Filling connection details...");
await this.host.fill(host);
await this.page.waitForTimeout(1000);
await this.port.fill(port)
await this.page.waitForTimeout(1000);
await this.userName.fill(username)
await this.page.waitForTimeout(1000);
await this.password.fill(password)
await this.password.fill(password);
console.log("Connection details filled.");
}

async getHostValue(){
Expand All @@ -60,8 +58,10 @@ class ConnectionPage{
}

async SubmitValidateCredential(){
console.log("Submitting credentials...");
await this.page.waitForTimeout(1000);
await this.validateCredential.click()
await this.validateCredential.click();
console.log("Credentials submitted.");
}

async clickContinueButton() {
Expand All @@ -75,12 +75,9 @@ class ConnectionPage{
async isContinueButtonVisible() {
return await this.continueButton.isDisabled();
}
async clickContinueButton() {
return await this.continueButton.click();
}
async isGreenCheckIconVisible() {
return await this.greenCheckIconSelector.isHidden();
}
}

export default ConnectionPage;
export default ConnectionPage;
92 changes: 59 additions & 33 deletions playwright_test/Pages/installation.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,94 +50,86 @@ class InstallationPage{
return await this.pageTitle.textContent({ timeout: 2000 });
}

async enterPrefix(prefix: any){
async enterPrefix(prefix: string): Promise<void>{
await this.page.waitForTimeout(500)
await this.prefix.fill(prefix);
}

async getPrefixValue(){
await this.page.waitForTimeout(500)
return await this.prefix.textContent();
async getPrefixValue(): Promise<string> {
return await this.prefix.inputValue();
}

async enterProcLib(proclib: any){
async enterProcLib(proclib: string): Promise<void> {
await this.page.waitForTimeout(500)
await this.procLib.fill(proclib);
}

async getProclibValue(){
await this.page.waitForTimeout(500)
return await this.procLib.textContent();

async getProclibValue(): Promise<string> {
return await this.procLib.inputValue();
}

async enterParmLib(parmlib: any){
async enterParmLib(parmlib: string): Promise<void>{
await this.page.waitForTimeout(500)
await this.parmLib.fill(parmlib);
}

async getParmlibValue(){
await this.page.waitForTimeout(500)
return await this.parmLib.textContent();
async getParmlibValue(): Promise<string> {
return await this.parmLib.inputValue();
}

async enterZis(zis: any){
async enterZis(zis: string): Promise<void> {
await this.page.waitForTimeout(500)
await this.zis.fill(zis);
}

async enterJclLib(Jcllib: any){
async enterJclLib(Jcllib: string): Promise<void> {
await this.page.waitForTimeout(500)
await this.jclLib.fill(Jcllib);
}

async enterLoadLib(loadlib: any){
async enterLoadLib(loadlib: string): Promise<void>{
await this.page.waitForTimeout(500)
await this.loadLib.fill(loadlib);
}

async enterAuthLoadLib(authloadlib: any){
await this.page.waitForTimeout(500)
async enterAuthLoadLib(authloadlib: string): Promise<void> {
await this.authLoadLib.fill(authloadlib);
await this.page.waitForTimeout(5000)
}

async getAuthLoadLibValue(){
await this.page.waitForTimeout(500)
return await this.authLoadLib.textContent();
async getAuthLoadLibValue(): Promise<string> {
return await this.authLoadLib.inputValue();
}

async enterAuthPluginLib(authpluginlib: any){
await this.page.waitForTimeout(500)
async enterAuthPluginLib(authpluginlib: string): Promise<void> {
await this.authPluginLib.fill(authpluginlib);
await this.page.waitForTimeout(5000)
}

async getAuthPluginLibValue(){
await this.page.waitForTimeout(500)
return await this.authPluginLib.textContent();
async getAuthPluginLibValue(): Promise<string> {
return await this.authPluginLib.inputValue();
}

async clickInstallMvsDatasets(){
await this.page.waitForTimeout(1000)
await this.installMVSDatasets.click();
await this.installMVSDatasets.click();
await this.waitForContinueButtonToBeEnabled();
}

async clickViewEditYaml(){
await this.page.waitForTimeout(500)
await this.viewEditYaml.click();
}

async clickViewSubmitJob(){
await this.page.waitForTimeout(500)
await this.viewSubmitJob.click();
}

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

async clickSaveAndClose(){
await this.page.waitForTimeout(500)
await this.saveAndClose.click({timeout: 2000});
}

Expand All @@ -157,14 +149,30 @@ class InstallationPage{
}

async isContinueToNetworkSetupDisabled(){
await this.page.waitForTimeout(500)
return await this.continueToNetworkSetup.isDisabled()
}

async isContinueToNetworkSetupEnabled(){
await this.page.waitForTimeout(500)
return await this.continueToNetworkSetup.isEnabled()
}

async isSkipToNetworkSetupEnabled(){
return await this.skipInstallation.isEnabled()
}

private async waitForContinueButtonToBeEnabled(): Promise<void> {
const timeout = 100000;
const interval = 500;
const endTime = Date.now() + timeout;
while (Date.now() < endTime) {
if (await this.isContinueToNetworkSetupEnabled()) {
return;
}
await this.page.waitForTimeout(interval);
}

throw new Error('Continue button was not enabled within the timeout period');
}

async open_monacoEditor(){
await this.page.waitForTimeout(1000)
Expand All @@ -177,5 +185,23 @@ class InstallationPage{
await this.page.waitForTimeout(500)
await this.closeEditorButton.click();
}

async clickInstallMvsDatasetsInvalid(){
await this.installMVSDatasets.click();
}

async fillAllFields(datasetPrefix: string, parmLib: string, procLib: string, jclLib: string, loadLib: string, authLoadLib: string, authPluginLib: string){
await this.enterPrefix(datasetPrefix);
await this.enterParmLib(parmLib);
await this.enterProcLib(procLib);
await this.enterJclLib(jclLib);
await this.enterLoadLib(loadLib);
await this.enterAuthLoadLib(authLoadLib);
await this.enterAuthPluginLib(authPluginLib);
await this.enterAuthLoadLib(authLoadLib);
await this.enterAuthPluginLib(authPluginLib);
await this.enterAuthLoadLib(authLoadLib);
await this.enterAuthPluginLib(authPluginLib);
}
}
export default InstallationPage;
Loading

0 comments on commit 8dd3f1b

Please sign in to comment.