Skip to content

Commit 3a1a9ae

Browse files
committed
Splitted "user has created or selected namespace" command as regular user requires additional steps
Signed-off-by: Oleksii Korniienko <[email protected]>
1 parent b72c130 commit 3a1a9ae

File tree

3 files changed

+26
-18
lines changed

3 files changed

+26
-18
lines changed

frontend/packages/webterminal-plugin/integration-tests/support/step-definitions/common/webTerminal.ts

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import { Given, When, Then, And } from 'cypress-cucumber-preprocessor/steps';
22
import { guidedTour } from '@console/cypress-integration-tests/views/guided-tour';
33
import { switchPerspective } from '@console/dev-console/integration-tests/support/constants';
4-
import { devNavigationMenuPO } from '@console/dev-console/integration-tests/support/pageObjects';
5-
import { adminNavigationMenuPO } from '@console/dev-console/integration-tests/support/pageObjects';
6-
import {
7-
perspective,
8-
projectNameSpace,
9-
} from '@console/dev-console/integration-tests/support/pages';
4+
import { perspective } from '@console/dev-console/integration-tests/support/pages';
105
import { checkTerminalIcon } from '@console/dev-console/integration-tests/support/pages/functions/checkTerminalIcon';
116
import { webTerminalPage } from '@console/webterminal-plugin/integration-tests/support/step-definitions/pages/web-terminal/webTerminal-page';
127

@@ -85,14 +80,6 @@ And('user has logged in as basic user', () => {
8580
// perspective.switchTo(switchPerspective.Developer);
8681
// });
8782

88-
// Given('user is at administrator perspective', () => {
89-
// perspective.switchTo(switchPerspective.Administrator);
90-
// });
91-
92-
Given('user has created or selected namespace {string}', (projectName: string) => {
93-
Cypress.env('NAMESPACE', projectName);
94-
// move to workload/topology page as "Project" page does not contain dropdown menu in regular user perspective.
95-
cy.get(adminNavigationMenuPO.workloads.main).click();
96-
cy.get(devNavigationMenuPO.topology).click();
97-
projectNameSpace.selectOrCreateProject(`${projectName}`);
83+
Given('user is at administrator perspective', () => {
84+
perspective.switchTo(switchPerspective.Administrator);
9885
});

frontend/packages/webterminal-plugin/integration-tests/support/step-definitions/web-terminal/web-teminal-basic.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import { When, Then, And, Given } from 'cypress-cucumber-preprocessor/steps';
2-
import { installWebterminalOperatorUsingCLI } from '@console/dev-console/integration-tests/support/pages';
2+
import {
3+
adminNavigationMenuPO,
4+
devNavigationMenuPO,
5+
} from '@console/dev-console/integration-tests/support/pageObjects';
6+
import {
7+
installWebterminalOperatorUsingCLI,
8+
projectNameSpace,
9+
} from '@console/dev-console/integration-tests/support/pages';
310
import { webTerminalPage } from '@console/webterminal-plugin/integration-tests/support/step-definitions/pages/web-terminal/webTerminal-page';
411

512
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', () => {
1724
});
1825

1926
And('user does nothing with displayed terminal window 1 minutes', () => {
20-
const terminalIdlingTimeout: number = Number(Cypress.env('TERMINAL_IDLING_TIMEOUT')) || 60000;
27+
const terminalIdlingTimeout: number = Number(Cypress.env('TERMINAL_IDLING_TIMEOUT')) || 180000; // [workaround] changed to 180 seconds due to https://issues.redhat.com/browse/WTO-334
2128
cy.wait(terminalIdlingTimeout);
2229
webTerminalPage.verifyInnactivityMessage(terminalIdlingTimeout);
2330
});
@@ -28,3 +35,11 @@ Then(
2835
webTerminalPage.verifyRestartTerminalButton();
2936
},
3037
);
38+
39+
Given('user has created or selected namespace {string}', (projectName: string) => {
40+
Cypress.env('NAMESPACE', projectName);
41+
cy.get(adminNavigationMenuPO.workloads.main).click();
42+
cy.get(devNavigationMenuPO.topology).click();
43+
projectNameSpace.selectOrCreateProject(`${projectName}`);
44+
// cy.get(devNavigationMenuPO.project).click();
45+
});

frontend/packages/webterminal-plugin/integration-tests/support/step-definitions/web-terminal/web-terminal-adminuser.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,9 @@ Then('user will see the terminal instance for namespace {string}', (nameSpace: s
128128
// Disabling following line due to terminal loading issue from backend at the first load
129129
// devWorkspacePage.verifyDevWsResourceStatus(devWorkspaceStatuses.running);
130130
});
131+
132+
Given('user has created or selected namespace {string}', (projectName: string) => {
133+
Cypress.env('NAMESPACE', projectName);
134+
projectNameSpace.selectOrCreateProject(`${projectName}`);
135+
// cy.get(devNavigationMenuPO.project).click();
136+
});

0 commit comments

Comments
 (0)