Skip to content

ODC-7782: Test adjustments to perspective merge #14970

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import {
perspective,
projectNameSpace,
} from '@console/dev-console/integration-tests/support/pages';
import { checkDeveloperPerspective } from '@console/dev-console/integration-tests/support/pages/functions/checkDeveloperPerspective';

Given('user is at developer perspective', () => {
checkDeveloperPerspective();
perspective.switchTo(switchPerspective.Developer);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const addPage = {
cy.byTestID('item dev-catalog').click();
app.waitForLoad();
detailsPage.titleShouldContain(pageTitle.SoftwareCatalog);
cy.testA11y(pageTitle.SoftwareCatalog);
// cy.testA11y(pageTitle.SoftwareCatalog);
break;
case 'Database':
case addOptions.Database:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const navigateTo = (opt: devNavigationMenu) => {
break;
}
case devNavigationMenu.Topology: {
cy.get(devNavigationMenuPO.topology).click();
cy.get(devNavigationMenuPO.topology).should('exist').click({ force: true });
cy.url().should('include', 'topology');
app.waitForLoad();
cy.url().then(($url) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { guidedTour } from '@console/cypress-integration-tests/views/guided-tour';

export const checkDeveloperPerspective = () => {
guidedTour.close();
cy.get('body').then(($body) => {
cy.byLegacyTestID('perspective-switcher-toggle').then(($switcher) => {
// switcher is present
Expand All @@ -19,15 +20,16 @@ export const checkDeveloperPerspective = () => {
`oc patch console.operator.openshift.io/cluster --type='merge' -p '{"spec":{"customization":{"perspectives":[{"id":"dev","visibility":{"state":"Enabled"}}]}}}'`,
{ failOnNonZeroExit: true },
).then((result) => {
cy.log(result.stdout);
cy.log(result.stderr);
});
cy.reload(true);
cy.document().its('readyState').should('eq', 'complete');
cy.exec(` oc rollout status -w deploy/console -n openshift-console`, {
failOnNonZeroExit: true,
}).then((result) => {
cy.log(result.stderr);
});
cy.reload(true);
cy.document().its('readyState').should('eq', 'complete');
cy.log('perspective switcher menu refreshed');
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
import { detailsPage } from '@console/cypress-integration-tests/views/details-page';
import { guidedTour } from '@console/cypress-integration-tests/views/guided-tour';
import { topologyPage } from '@console/topology/integration-tests/support/pages/topology';
import { devNavigationMenu, addOptions } from '../../constants';
import { devNavigationMenu, addOptions, pageTitle } from '../../constants';
import { formPO, topologyPO } from '../../pageObjects';
import { addPage, gitPage } from '../add-flow';
import { createForm, navigateTo } from '../app';

export const selectImportFromGitQuickCreate = () => {
guidedTour.close();
cy.get('[data-test="quick-create-dropdown"]').click();
cy.get('[data-test="qc-import-from-git"] [role="menuitem"]')
.should('be.visible')
.click({ force: true });
cy.testA11y('Import from Git Page');
detailsPage.titleShouldContain(pageTitle.Git);
};

export const createGitWorkload = (
gitUrl: string = 'https://github.com/sclorg/nodejs-ex.git',
componentName: string = 'nodejs-ex-git',
Expand All @@ -12,7 +24,7 @@ export const createGitWorkload = (
isPipelineSelected: boolean = false,
isServerlessFunction: boolean = false,
) => {
addPage.selectCardFromOptions(addOptions.ImportFromGit);
selectImportFromGitQuickCreate();
gitPage.enterGitUrl(gitUrl);
gitPage.verifyValidatedMessage(gitUrl);
gitPage.enterComponentName(componentName);
Expand Down Expand Up @@ -52,7 +64,6 @@ export const createGitWorkloadIfNotExistsOnTopologyPage = (
cy.get('body').then(($body) => {
if ($body.find(topologyPO.emptyStateIcon).length) {
cy.log(`Topology doesn't have workload "${componentName}", lets create it`);
navigateTo(devNavigationMenu.Add);
createGitWorkload(
gitUrl,
componentName,
Expand All @@ -68,7 +79,6 @@ export const createGitWorkloadIfNotExistsOnTopologyPage = (
if ($node.find(topologyPO.highlightNode).length) {
cy.log(`knative service: ${componentName} is already created`);
} else {
navigateTo(devNavigationMenu.Add);
createGitWorkload(
gitUrl,
componentName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
closeExportNotification,
} from '../../pages';
import { navigateTo } from '../../pages/app';
import { checkDeveloperPerspective } from '../../pages/functions/checkDeveloperPerspective';

Given(
'user has created {string} workload in {string} application',
Expand All @@ -23,6 +24,7 @@ Given(
);

Given('user is at Add page', () => {
checkDeveloperPerspective();
navigateTo(devNavigationMenu.Add);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import { addOptions, devNavigationMenu } from '../../constants';
import { addPagePO, helmChartRepositoriesPO } from '../../pageObjects';
import { addPage, createForm, navigateTo } from '../../pages';
import { helmChartRepository } from '../../pages/add-flow/helm-chart-repository';
import { checkDeveloperPerspective } from '../../pages/functions/checkDeveloperPerspective';

Given('user is at Add page', () => {
checkDeveloperPerspective();
navigateTo(devNavigationMenu.Add);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
import { detailsPage } from '@console/cypress-integration-tests/views/details-page';
import { addOptions, devNavigationMenu } from '../../constants';
import { addPage, navigateTo } from '../../pages';
import { checkDeveloperPerspective } from '../../pages/functions/checkDeveloperPerspective';

Given('user is at Add page', () => {
checkDeveloperPerspective();
navigateTo(devNavigationMenu.Add);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ import {
createGitWorkloadIfNotExistsOnTopologyPage,
verifyAndInstallGitopsPrimerOperator,
} from '../../pages';
import { checkDeveloperPerspective } from '../../pages/functions/checkDeveloperPerspective';

Given('user is at Add page', () => {
checkDeveloperPerspective();
navigateTo(devNavigationMenu.Add);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { modal } from '@console/cypress-integration-tests/views/modal';
import { nav } from '@console/cypress-integration-tests/views/nav';
import { switchPerspective, devNavigationMenu, adminNavigationMenu } from '../../constants';
import { perspective, projectNameSpace, navigateTo, app } from '../../pages';
import { checkDeveloperPerspective } from '../../pages/functions/checkDeveloperPerspective';

Given('user has logged in as a basic user', () => {
cy.logout();
Expand All @@ -17,6 +18,7 @@ Given('user has logged in as a basic user', () => {
});

Given('user is at developer perspective', () => {
checkDeveloperPerspective();
perspective.switchTo(switchPerspective.Developer);
// Due to bug ODC-6231
// cy.testA11y('Developer perspective with guide tour modal');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ import {
topologyPage,
verifyAddPage,
} from '../../pages';
import { checkDeveloperPerspective } from '../../pages/functions/checkDeveloperPerspective';

Given('user is at developer perspective', () => {
checkDeveloperPerspective();
perspective.switchTo(switchPerspective.Developer);
});

Expand All @@ -22,6 +24,7 @@ Given('user has created or selected namespace {string}', (projectName: string) =
});

Given('user is at Add page', () => {
checkDeveloperPerspective();
navigateTo(devNavigationMenu.Add);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ import {
catalogPage,
addPage,
} from '@console/dev-console/integration-tests/support/pages';
import { checkDeveloperPerspective } from '@console/dev-console/integration-tests/support/pages/functions/checkDeveloperPerspective';

Given('user is at developer perspective', () => {
checkDeveloperPerspective();
perspective.switchTo(switchPerspective.Developer);
// cy.testA11y('Developer perspective with guider tour modal');
});
Expand Down Expand Up @@ -110,6 +112,7 @@ When('user clicks on the link for the {string} of helm release', (resource: stri
});

Given('user is at Add page', () => {
checkDeveloperPerspective();
navigateTo(devNavigationMenu.Add);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
perspective,
createForm,
} from '@console/dev-console/integration-tests/support/pages';
import { checkDeveloperPerspective } from '@console/dev-console/integration-tests/support/pages/functions/checkDeveloperPerspective';
import { topologyPage } from '@console/topology/integration-tests/support/pages/topology/topology-page';
import { helmPage, helmDetailsPage } from '../../pages';

Expand All @@ -30,6 +31,7 @@ const deleteChartRepositoryFromDetailsPage = (name: string, type: string) => {
};

Given('user is at developer perspective', () => {
checkDeveloperPerspective();
perspective.switchTo(switchPerspective.Developer);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
projectNameSpace,
app,
} from '@console/dev-console/integration-tests/support/pages';
import { checkDeveloperPerspective } from '@console/dev-console/integration-tests/support/pages/functions/checkDeveloperPerspective';

When('user selects YAML view', () => {
cy.document().its('readyState').should('eq', 'complete');
Expand Down Expand Up @@ -80,6 +81,7 @@ Then('user will see A-Z, Z-A sort by dropdown', () => {
});

Given('user is at Add page', () => {
checkDeveloperPerspective();
navigateTo(devNavigationMenu.Add);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Feature: Eventing page at Administrator perspective

@regression
Scenario: Create new Event Source: KA-01-TC01
Given user has created knative service "hello-openshift"
Given user has created knative service "hello-openshift" in admin
And user is at administrator perspective
And user is at eventing page
When user clicks on Create dropdown button
Expand All @@ -20,8 +20,8 @@ Feature: Eventing page at Administrator perspective
And user enters "* * * * *" in Schedule field
And user selects resource "hello-openshift"
And user clicks on Create button to submit
Then user will be redirected to Project Details page
And user will see ping-source created
Then user will be redirected to Topology page
And ApiServerSource event source "ping-source" is created and linked to selected knative service "hello-openshift"


@regression
Expand All @@ -31,8 +31,8 @@ Feature: Eventing page at Administrator perspective
And user selects Channel
And user selects Default channels
And user clicks on Create button to create channel
Then user will be redirected to Project Details page
And user will see channel created
Then user will be redirected to Topology page
And user will see the channel "channel" created


@manual
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Feature: Filters on Serving and Eventing page

Background:
Given user has created or selected namespace "aut-serving-eventing"
And user has created knative service "hello-openshift"
And user has created knative service "hello-openshift" in admin
And user is at administrator perspective

@regression
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Feature: Serving page at Administrator perspective

Background:
Given user has created or selected namespace "aut-serving-page"
And user has created knative service "hello-openshift"
And user has created knative service "hello-openshift" in admin
And user is at administrator perspective


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ Feature: Perform actions on knative service and revision
As a user, I want to perform edit or delete operations on knative revision in topology page

Background:
And user is at Topology page
And user is at Topology page in the admin view

@pre-condition
Scenario Outline: Create knative workload from From Git card on Add page: KN-05-TC04
Given user has created or selected namespace "knative-ci"
And user is at Add page
And user is at Import from Git page
And user selects Import from Git from quick create
When user enters Git Repo url as "<git_url>"
And user enters Name as "<workload_name>"
And user selects resource type as "Serverless Deployment"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Feature: Perform actions on knative revision
@pre-condition
Scenario Outline: Create knative workload from From Git card on Add page: KN-05-TC04
Given user is at Add page
And user is at Import from Git page
# And user is at Import from Git page
And user selects Import from Git from quick create
When user enters Git Repo url as "<git_url>"
And user enters Name as "<workload_name>"
And user selects resource type as "Serverless Deployment"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Feature: Create a workload of 'knative Service' type resource

Background:
Given user has created or selected namespace "aut-knative-workload"
And user is at Add page


@regression
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { checkErrors } from '@console/cypress-integration-tests/support';
import { guidedTour } from '@console/cypress-integration-tests/views/guided-tour';
import { installKnativeOperatorUsingCLI } from '@console/dev-console/integration-tests/support/pages';
import { checkDeveloperPerspective } from '@console/dev-console/integration-tests/support/pages/functions/checkDeveloperPerspective';

before(() => {
cy.exec('../../../../contrib/create-user.sh');
Expand All @@ -10,7 +9,6 @@ before(() => {
const bridgePasswordPassword: string = Cypress.env('BRIDGE_HTPASSWD_PASSWORD') || 'test';
cy.login(bridgePasswordIDP, bridgePasswordUsername, bridgePasswordPassword);
cy.document().its('readyState').should('eq', 'complete');
checkDeveloperPerspective();
installKnativeOperatorUsingCLI();
// To ignore the resizeObserverLoopErrors on CI, adding below code
const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/;
Expand All @@ -26,9 +24,8 @@ before(() => {
});

beforeEach(() => {
cy.initDeveloper();
// cy.initAdmin();
// cy.byLegacyTestID('topology-header').should('exist').click({force: true});
cy.initAdmin();
cy.byLegacyTestID('topology-header').should('exist').click({ force: true });
});

after(() => {
Expand Down
Loading