diff --git a/frontend/packages/webterminal-plugin/integration-tests/features/web-terminal/web-teminal-basic.feature b/frontend/packages/webterminal-plugin/integration-tests/features/web-terminal/web-teminal-basic.feature index 936b2d6f7c1f..81cccf419db9 100644 --- a/frontend/packages/webterminal-plugin/integration-tests/features/web-terminal/web-teminal-basic.feature +++ b/frontend/packages/webterminal-plugin/integration-tests/features/web-terminal/web-teminal-basic.feature @@ -4,14 +4,14 @@ Feature: Web Terminal Background: Given user has logged in as basic user - And user has installed webTerminal in namespace "aut-terminal-basic" + # And user has installed webTerminal in namespace "aut-terminal-basic" And user has created or selected namespace "aut-terminal-basic" @regression Scenario: Open existing Web Terminal instance: WT-01-TC01 When user clicks on the Web Terminal icon on the Masthead And user clicks advanced option for Timeout - And user sets timeout to 1 Minute + And user sets timeout to "1" Minute And user clicks on Start button Then user will see the terminal window And user close current Web Terminal session diff --git a/frontend/packages/webterminal-plugin/integration-tests/support/step-definitions/common/webTerminal.ts b/frontend/packages/webterminal-plugin/integration-tests/support/step-definitions/common/webTerminal.ts index 8b2585e1146b..8559058270b1 100644 --- a/frontend/packages/webterminal-plugin/integration-tests/support/step-definitions/common/webTerminal.ts +++ b/frontend/packages/webterminal-plugin/integration-tests/support/step-definitions/common/webTerminal.ts @@ -1,18 +1,14 @@ import { Given, When, Then, And } from 'cypress-cucumber-preprocessor/steps'; import { guidedTour } from '@console/cypress-integration-tests/views/guided-tour'; import { switchPerspective } from '@console/dev-console/integration-tests/support/constants'; -import { devNavigationMenuPO } from '@console/dev-console/integration-tests/support/pageObjects'; -import { - perspective, - projectNameSpace, -} from '@console/dev-console/integration-tests/support/pages'; +import { perspective } from '@console/dev-console/integration-tests/support/pages'; import { checkDeveloperPerspective } from '@console/dev-console/integration-tests/support/pages/functions/checkDeveloperPerspective'; import { checkTerminalIcon } from '@console/dev-console/integration-tests/support/pages/functions/checkTerminalIcon'; import { webTerminalPage } from '@console/webterminal-plugin/integration-tests/support/step-definitions/pages/web-terminal/webTerminal-page'; -const idp = Cypress.env('BRIDGE_HTPASSWD_IDP') || 'consoledeveloper'; -const username = Cypress.env('BRIDGE_HTPASSWD_USERNAME') || 'consoledeveloper'; -const password = Cypress.env('BRIDGE_HTPASSWD_PASSWORD') || 'developer'; +const idp = Cypress.env('BRIDGE_HTPASSWD_IDP') || 'test'; +const username = Cypress.env('BRIDGE_HTPASSWD_USERNAME') || 'test'; +const password = Cypress.env('BRIDGE_HTPASSWD_PASSWORD') || 'test'; const kubeAdmUserName = Cypress.env('KUBEADMIN_NAME') || 'kubeadmin'; const kubeAdmUserPass = Cypress.env('BRIDGE_KUBEADMIN_PASSWORD'); @@ -77,8 +73,6 @@ And('user has logged in as basic user', () => { // sometimes guide tour is not closed properly without delay cy.wait(1000); guidedTour.close(); - perspective.switchTo(switchPerspective.Developer); - cy.get(devNavigationMenuPO.project).click(); }); Given('user is at developer perspective', () => { @@ -89,8 +83,3 @@ Given('user is at developer perspective', () => { Given('user is at administrator perspective', () => { perspective.switchTo(switchPerspective.Administrator); }); - -Given('user has created or selected namespace {string}', (projectName: string) => { - Cypress.env('NAMESPACE', projectName); - projectNameSpace.selectOrCreateProject(`${projectName}`); -}); diff --git a/frontend/packages/webterminal-plugin/integration-tests/support/step-definitions/pages/web-terminal/initTerminal-page.ts b/frontend/packages/webterminal-plugin/integration-tests/support/step-definitions/pages/web-terminal/initTerminal-page.ts index cd207d60ccbc..2ea081dc8b2d 100644 --- a/frontend/packages/webterminal-plugin/integration-tests/support/step-definitions/pages/web-terminal/initTerminal-page.ts +++ b/frontend/packages/webterminal-plugin/integration-tests/support/step-definitions/pages/web-terminal/initTerminal-page.ts @@ -1,13 +1,6 @@ -import { switchPerspective } from '@console/dev-console/integration-tests/support/constants'; import { formPO } from '@console/dev-console/integration-tests/support/pageObjects'; import { webTerminalPO } from '@console/dev-console/integration-tests/support/pageObjects/webterminal-po'; -import { - app, - perspective, - projectNameSpace, -} from '@console/dev-console/integration-tests/support/pages/app'; -import { searchResource } from '@console/dev-console/integration-tests/support/pages/search-resources/search-page'; -import { webTerminalPage } from './webTerminal-page'; +import { app } from '@console/dev-console/integration-tests/support/pages/app'; export const initTerminalPage = { clickOnProjectDropDown: () => { @@ -25,26 +18,8 @@ export const initTerminalPage = { clickStartButton: () => { cy.get(formPO.create).should('be.enabled').click({ force: true }); - cy.get('body').then(($body) => { - cy.wait(5000); - // Due to initialization issue if multiple operators present OCPBUGS-44891 - if ($body.find('[data-test="loading-box-body"]').length === 0) { - cy.log('loading did not go through'); - cy.wait(10000); - cy.get(webTerminalPO.terminalCloseWindowBtn).click(); - cy.reload(); - app.waitForDocumentLoad(); - perspective.switchTo(switchPerspective.Administrator); - cy.byLegacyTestID('topology-header').should('exist').click({ force: true }); - projectNameSpace.selectProject('openshift-terminal'); - webTerminalPage.clickOpenCloudShellBtn(); - searchResource.searchResourceByNameAsAdmin('DevWorkspace'); - searchResource.selectSearchedItem('terminal'); - // cy.get('[data-test="loading-indicator"]').should('not.exist', { timeout: 210000 }); - } else { - cy.wait(5000); - } - }); + cy.get('[data-test="loading-box-body"]').should('exist', { timeout: 5000 }); // wait for "loading..." appears + cy.get('[data-test="loading-box-body"]').should('not.exist', { timeout: 180000 }); // wait for terminal loading }, selectProject: (projectName: string) => { diff --git a/frontend/packages/webterminal-plugin/integration-tests/support/step-definitions/web-terminal/web-teminal-basic.ts b/frontend/packages/webterminal-plugin/integration-tests/support/step-definitions/web-terminal/web-teminal-basic.ts index dcc546455e24..63d89d09c7eb 100644 --- a/frontend/packages/webterminal-plugin/integration-tests/support/step-definitions/web-terminal/web-teminal-basic.ts +++ b/frontend/packages/webterminal-plugin/integration-tests/support/step-definitions/web-terminal/web-teminal-basic.ts @@ -1,5 +1,12 @@ import { When, Then, And, Given } from 'cypress-cucumber-preprocessor/steps'; -import { installWebterminalOperatorUsingCLI } from '@console/dev-console/integration-tests/support/pages'; +import { + adminNavigationMenuPO, + devNavigationMenuPO, +} from '@console/dev-console/integration-tests/support/pageObjects'; +import { + installWebterminalOperatorUsingCLI, + projectNameSpace, +} from '@console/dev-console/integration-tests/support/pages'; import { webTerminalPage } from '@console/webterminal-plugin/integration-tests/support/step-definitions/pages/web-terminal/webTerminal-page'; Given('user with basic rights has installed Web Terminal operator', () => { @@ -17,7 +24,7 @@ Then('user will see the terminal window opened in new tab', () => { }); And('user does nothing with displayed terminal window 1 minutes', () => { - const terminalIdlingTimeout: number = Number(Cypress.env('TERMINAL_IDLING_TIMEOUT')) || 60000; + const terminalIdlingTimeout: number = Number(Cypress.env('TERMINAL_IDLING_TIMEOUT')) || 180000; // [workaround] changed to 180 seconds due to https://issues.redhat.com/browse/WTO-334 cy.wait(terminalIdlingTimeout); webTerminalPage.verifyInnactivityMessage(terminalIdlingTimeout); }); @@ -28,3 +35,11 @@ Then( webTerminalPage.verifyRestartTerminalButton(); }, ); + +Given('user has created or selected namespace {string}', (projectName: string) => { + Cypress.env('NAMESPACE', projectName); + cy.get(adminNavigationMenuPO.workloads.main).click(); + cy.get(devNavigationMenuPO.topology).click(); + projectNameSpace.selectOrCreateProject(`${projectName}`); + // cy.get(devNavigationMenuPO.project).click(); +}); diff --git a/frontend/packages/webterminal-plugin/integration-tests/support/step-definitions/web-terminal/web-terminal-adminuser.ts b/frontend/packages/webterminal-plugin/integration-tests/support/step-definitions/web-terminal/web-terminal-adminuser.ts index 86ac5c8c7513..7c97ad405ff0 100644 --- a/frontend/packages/webterminal-plugin/integration-tests/support/step-definitions/web-terminal/web-terminal-adminuser.ts +++ b/frontend/packages/webterminal-plugin/integration-tests/support/step-definitions/web-terminal/web-terminal-adminuser.ts @@ -128,3 +128,9 @@ Then('user will see the terminal instance for namespace {string}', (nameSpace: s // Disabling following line due to terminal loading issue from backend at the first load // devWorkspacePage.verifyDevWsResourceStatus(devWorkspaceStatuses.running); }); + +Given('user has created or selected namespace {string}', (projectName: string) => { + Cypress.env('NAMESPACE', projectName); + projectNameSpace.selectOrCreateProject(`${projectName}`); + // cy.get(devNavigationMenuPO.project).click(); +});