Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test vsam stcs tabs #247

Merged
merged 17 commits into from
Nov 13, 2024
Prev Previous commit
Next Next commit
Added test in stcs and vsam tab to read yaml
Signed-off-by: hpathak <[email protected]>
hpathak committed Oct 10, 2024
commit e5677b592a23fc5b402b004baabf9656c2bd46c1
64 changes: 23 additions & 41 deletions playwright_test/Tests/Stcs.spec.ts
Original file line number Diff line number Diff line change
@@ -9,14 +9,15 @@ import SecurityPage from '../Pages/security.page.ts'
import StcsPage from '../Pages/stcs.page.ts'
import config from '../utils/config';
import ApfAuthPage from '../Pages/ApfAuth.page';
import { runSSHCommand } from '../utils/sshUtils';
import { connectArgs, Script } from '../setup';


let electronApp: ElectronApplication
const STCS_TITLE = 'Stcs'
const SECURITY_TITLE = 'Security';
const CERTIFICATE_TITLE = 'Certificates'

const script = new Script();

test.describe('StcsTab', () => {
let connectionPage: ConnectionPage;
@@ -97,13 +98,14 @@ test.describe('StcsTab', () => {
await electronApp.close()
})


test('test title and required fields of page', async ({ page }) => {
const title = await stcsPage.returnTitleOfStcsPage();
expect(title).toBe(STCS_TITLE);
await expect(stcsPage.zis).toBeTruthy()
await expect(stcsPage.zowe).toBeTruthy()
await expect(stcsPage.aux).toBeTruthy()
await expect(stcsPage.dataset_proclib).toBeTruthy()
const title = await stcsPage.returnTitleOfStcsPage();
expect(title).toBe(STCS_TITLE);
await expect(stcsPage.zis).toBeTruthy()
await expect(stcsPage.zowe).toBeTruthy()
await expect(stcsPage.aux).toBeTruthy()
await expect(stcsPage.dataset_proclib).toBeTruthy()
})

test('test values match with previous step', async ({ page }) => {
@@ -121,22 +123,17 @@ test.describe('StcsTab', () => {
expect(Aux_Value).toBe(aux_value);
})
test('verify yaml updated on zos', async ({ page }) => {
const command = `cat ${process.env.ZOWE_ROOT_DIR}/zowe.yaml`;

try {
const yaml = await runSSHCommand(command);
expect(yaml).toContain(config.SECURITY_AUX);
expect(yaml).toContain(config.SECURITY_STC_ZOWE);
expect(yaml).toContain(config.SECURITY_STC_ZIS);
} catch (error) {
console.error('Error executing command:', error.message);
}
const result = await script.runCommand(`cat ${process.env.ZOWE_ROOT_DIR}/zowe.yaml`);
await expect(result.details).toContain(config.SECURITY_AUX);
await expect(result.details).toContain(config.SECURITY_STC_ZOWE);
await expect(result.details).toContain(config.SECURITY_STC_ZIS);
});


test('Test view yaml button', async ({ page }) => {
await stcsPage.viewYaml()
await expect(stcsPage.editor_title_element).toBeTruthy();
await stcsPage.closeButton()
await stcsPage.viewYaml()
await expect(stcsPage.editor_title_element).toBeTruthy();
await stcsPage.closeButton()
})

test('Test view job', async ({ page }) => {
@@ -162,19 +159,9 @@ test.describe('StcsTab', () => {

test('Test continue to certificate button is disable', async ({ page }) => {
const is_ContinueButtonDisable = await stcsPage.isContinueButtonDisable();
expect(is_ContinueButtonDisable).toBe(true);
await expect(is_ContinueButtonDisable).toBe(true);
})

test('Test yaml should be updated', async ({ page }) => {
await stcsPage.viewYaml();
await expect(stcsPage.editor_title_element).toBeTruthy();
const yaml = await stcsPage.read_yaml();
expect(yaml).toContain(config.SECURITY_AUX);
expect(yaml).toContain(config.SECURITY_STC_ZOWE);
expect(yaml).toContain(config.SECURITY_STC_ZIS);

})

test('Test Resume Progress', async ({ page }) => {
await stcsPage.click_saveAndClose()
await titlePage.clickOnResumeProgress()
@@ -194,16 +181,11 @@ test.describe('StcsTab', () => {

test('verify stcs applied successfully on zos after initialization', async ({ page }) => {
await stcsPage.initializeSTC()
const command = `tsocmd "LISTDS '${config.PROC_LIB}' MEMBERS"`;

try {
const yaml = await runSSHCommand(command);
expect(yaml).toContain(config.SECURITY_AUX);
expect(yaml).toContain(config.SECURITY_STC_ZOWE);
expect(yaml).toContain(config.SECURITY_STC_ZIS);
} catch (error) {
console.error('Error executing command:', error.message);
}
const result = await script.runCommand(`tsocmd "LISTDS '${config.PROC_LIB}' MEMBERS"`);
await expect(result.details).toContain(config.SECURITY_AUX);
await expect(result.details).toContain(config.SECURITY_STC_ZOWE);
await expect(result.details).toContain(config.SECURITY_STC_ZIS);

// verify all checks are sucessfully checked
const isWriteConfig_check_visible = await stcsPage.isWriteConfigGreenCheckVisible();
expect(isWriteConfig_check_visible).toBe(true);
29 changes: 11 additions & 18 deletions playwright_test/Tests/Vsam.spec.ts
Original file line number Diff line number Diff line change
@@ -10,14 +10,15 @@ import StcsPage from '../Pages/stcs.page.ts'
import config from '../utils/config';
import ApfAuthPage from '../Pages/ApfAuth.page';
import VsamPage from '../Pages/Vsam.page';
import { runSSHCommand } from '../utils/sshUtils';
import { connectArgs, Script } from '../setup';


let electronApp: ElectronApplication
const VSAM_TITLE = 'Vsam'
const CERTIFICATE_TITLE = 'Certificates';
const LAUNCHCONFIG_TITLE = 'Configuration'
const INVALID_ERRORMSG = 'Invalid input. Please enter a valid VSAM dataset name.'
const script = new Script()

test.describe('VsamPage', () => {
let connectionPage: ConnectionPage;
@@ -153,15 +154,11 @@ test.describe('VsamPage', () => {
test('Test NONRLS YAML Update on z/OS After Init', async ({ page }) => {
await vsamPage.fillVsamDetails('NONRLS',config.VOLUME,'', config.VSAM_DATASET_NAME)
await vsamPage.initializeVSAM();
const command = `cat ${process.env.ZOWE_ROOT_DIR}/zowe.yaml`;
try {
const yaml = await runSSHCommand(command);
expect(yaml).toContain('NONRLS');
expect(yaml).toContain(config.VOLUME);
expect(yaml).toContain(config.VSAM_DATASET_NAME);
} catch (error) {
console.error('Error executing command:', error.message);
}
const result = await script.runCommand(`cat ${process.env.ZOWE_ROOT_DIR}/zowe.yaml`);
await expect(result.details).toContain('NONRLS');
await expect(result.details).toContain(config.VOLUME);
await expect(result.details).toContain(config.VSAM_DATASET_NAME);

const isWriteConfig_check_visible = await vsamPage.isWriteConfigGreenCheckVisible();
expect(isWriteConfig_check_visible).toBe(true);
const isUploadConfig_check_visible = await vsamPage.isUploadConfigGreenCheckVisible();
@@ -173,14 +170,10 @@ test.describe('VsamPage', () => {
test('Verify VSAM dataset was successfully created on z/OS.', async ({ page }) => {
await vsamPage.fillVsamDetails('RLS',config.VOLUME,'', config.VSAM_DATASET_NAME)
await vsamPage.initializeVSAM();
const command = `tso "LISTCAT"`;

try {
const yaml = await runSSHCommand(command);
expect(yaml).toContain(config.VSAM_DATASET_NAME);
} catch (error) {
console.error('Error executing command:', error.message);
}
const result = await script.runCommand(`tso "LISTCAT"`);

await expect(result.details).toContain(config.VSAM_DATASET_NAME);

});

test('Test save and close and Resume Progress', async ({ page }) => {
2 changes: 1 addition & 1 deletion playwright_test/prepare.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Script = require('./setup.js');
import { connectArgs, Script } from './setup';

async function prepareEnvironment(options = {}) {
const { install = false, remove = false } = options;

Unchanged files with check annotations Beta

import { Page,ElectronApplication, Locator,_electron as electron } from '@playwright/test';

Check failure on line 1 in playwright_test/Pages/apfAuth.page.ts

GitHub Actions / lint

missing header

Check warning on line 1 in playwright_test/Pages/apfAuth.page.ts

GitHub Actions / lint

'electron' is defined but never used
let electronApp: ElectronApplication

Check warning on line 2 in playwright_test/Pages/apfAuth.page.ts

GitHub Actions / lint

'electronApp' is defined but never used
class ApfAuthPage{
page: Page;
import { Page,Locator } from '@playwright/test';

Check failure on line 1 in playwright_test/Pages/connection.page.ts

GitHub Actions / lint

missing header
class ConnectionPage{
page: Page;
import { Page,Locator } from '@playwright/test';

Check failure on line 1 in playwright_test/Pages/installation.page.ts

GitHub Actions / lint

missing header
class InstallationPage{
page: Page;
import { Page,Locator } from '@playwright/test';

Check failure on line 1 in playwright_test/Pages/installationType.page.ts

GitHub Actions / lint

missing header
class InstallationTypePage{
page: Page;
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')]")

Check failure on line 29 in playwright_test/Pages/installationType.page.ts

GitHub Actions / lint

Mixed spaces and tabs
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.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')]")

Check failure on line 39 in playwright_test/Pages/installationType.page.ts

GitHub Actions / lint

Mixed spaces and tabs
this.continueCompInstallation = page.locator("//button[contains(text(),'Continue to Components Installation')]")

Check failure on line 40 in playwright_test/Pages/installationType.page.ts

GitHub Actions / lint

Mixed spaces and tabs
this.skipUnpaxButton = page.locator("//button[text()='Skip ']")

Check failure on line 41 in playwright_test/Pages/installationType.page.ts

GitHub Actions / lint

Mixed spaces and tabs
this.continueToUnpax = page.locator("//button[contains(text(),'Continue to Unpax')]")

Check failure on line 42 in playwright_test/Pages/installationType.page.ts

GitHub Actions / lint

Mixed spaces and tabs
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"]')
async continueComponentInstallation(){
const timeout = 5000;
const interval = 500;
while (true) {

Check failure on line 75 in playwright_test/Pages/installationType.page.ts

GitHub Actions / lint

Unexpected constant condition
if (await this.continueCompInstallation.isEnabled()) {
await this.continueCompInstallation.click();
return;
await this.skipUnpaxButton.click({timeout: 5000});
}
async enterRuntimeDir(runtimeDir: any){

Check warning on line 133 in playwright_test/Pages/installationType.page.ts

GitHub Actions / lint

Unexpected any. Specify a different type
await this.runtimeDir.clear({timeout: 5000})
await this.runtimeDir.fill(runtimeDir);
}
await this.clickAgreeLicense()
}
async uploadZowePaxAndNavigateToInstallationPage(uploadPaxPath: any){

Check warning on line 152 in playwright_test/Pages/installationType.page.ts

GitHub Actions / lint

Unexpected any. Specify a different type
this.selectUploadZowePax()
await this.uploadPaxButton.setInputFiles(uploadPaxPath)
}
async smpeZowePaxAndNavigateToInstallationPage(runtimeDir: any){

Check warning on line 157 in playwright_test/Pages/installationType.page.ts

GitHub Actions / lint

Unexpected any. Specify a different type
this.selectSmpe()
this.enterRuntimeDir(runtimeDir)
this.clickValidateLocation()
import { Page,ElectronApplication, Locator,_electron as electron } from '@playwright/test';

Check warning on line 1 in playwright_test/Pages/launchConfig.page.ts

GitHub Actions / lint

'electron' is defined but never used
let electronApp: ElectronApplication

Check warning on line 2 in playwright_test/Pages/launchConfig.page.ts

GitHub Actions / lint

'electronApp' is defined but never used
class LaunchConfigPage{
page: Page;
import { Page,ElectronApplication, Locator,_electron as electron } from '@playwright/test';

Check warning on line 1 in playwright_test/Pages/networking.page.ts

GitHub Actions / lint

'electron' is defined but never used
let electronApp: ElectronApplication

Check warning on line 2 in playwright_test/Pages/networking.page.ts

GitHub Actions / lint

'electronApp' is defined but never used
class NetworkingPage{
page: Page;
import { Locator, Page } from '@playwright/test';
let page: Page;

Check warning on line 2 in playwright_test/Pages/planning.page.ts

GitHub Actions / lint

'page' is defined but never used
class PlanningPage{
page: Page;