Skip to content

Commit

Permalink
Merge pull request #1011 from Katka92/enable_sbom_test
Browse files Browse the repository at this point in the history
fix(e2e): fix and stabilize e2e tests
  • Loading branch information
openshift-merge-bot[bot] authored Nov 4, 2024
2 parents 926365b + c9944e9 commit f7a700f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
6 changes: 5 additions & 1 deletion integration-tests/support/pages/ComponentsPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ export class ComponentPage extends AbstractWizardPage {
cy.get(ComponentsPagePO.create).should('be.enabled').click();
}

openPipelinePlanModal() {
clickManageBuildPipelinesLink() {
cy.contains('button', 'Manage build pipelines').should('be.visible').click();
}

clickMergePullRequest() {
cy.contains('button', 'Merge pull request').should('be.visible').click();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export class TaskRunsTab {
{ name: `${pipelineName}-init`, task: 'init', status: 'Succeeded' },
{ name: `${pipelineName}-clone-repository`, task: 'clone-repository', status: 'Succeeded' },
{ name: `${pipelineName}-build-container`, task: 'build-container', status: 'Succeeded' },
{ name: `${pipelineName}-show-summary`, task: 'show-summary', status: 'Succeeded' },
{ name: `${pipelineName}-show-sbom`, task: 'show-sbom', status: 'Succeeded' },
];
}

Expand Down
3 changes: 2 additions & 1 deletion integration-tests/tests/advanced-happy-path.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ describe('Advanced Happy path', () => {
const repoLink = `https://github.com/${repoOwner}/${repoName}`;
const gitHubUser = Cypress.env('GH_USERNAME');
const componentName = Common.generateAppName('go');
// testing other then default option, may take longer
const pipeline = 'docker-build';
const dockerfilePath = 'docker/Dockerfile';

Expand Down Expand Up @@ -100,7 +101,7 @@ describe('Advanced Happy path', () => {
describe('Trigger a new Pipelinerun related to push event', () => {
it('Merge the auto-generated PR, and verify the event status on modal', () => {
Applications.goToComponentsTab();
componentPage.openPipelinePlanModal();
componentPage.clickManageBuildPipelinesLink();
componentPage.verifyAndWaitForPRIsSent();

APIHelper.mergePR(
Expand Down
9 changes: 5 additions & 4 deletions integration-tests/tests/basic-happy-path.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ describe('Basic Happy Path', () => {
const repoOwner = 'redhat-hac-qe';
const publicRepo = `https://github.com/${repoOwner}/${repoName}`;
const componentName: string = Common.generateAppName('java-quarkus');
const piplinerunlogsTasks = ['init', 'clone-repository', 'build-container', 'show-summary'];
const piplinerunlogsTasks = ['init', 'clone-repository', 'build-container', 'show-sbom'];
const quarkusDeplomentBody = 'Congratulations, you have created a new Quarkus cloud application';
const pipeline = 'docker-build';
// this is default option and should be the fastest one
const pipeline = 'docker-build-oci-ta';

before(function () {
APIHelper.createRepositoryFromTemplate(sourceOwner, sourceRepo, repoOwner, repoName);
Expand Down Expand Up @@ -106,7 +107,7 @@ describe('Basic Happy Path', () => {
// Pipeline build plan was removed from the Pipeline runs Tab
// See https://issues.redhat.com/browse/KFLUXBUGS-603
ComponentsTabPage.openComponent(componentName);
componentPage.openPipelinePlanModal();
componentPage.clickMergePullRequest();
componentPage.verifyAndWaitForPRIsSent();

APIHelper.mergePR(
Expand Down Expand Up @@ -177,7 +178,7 @@ describe('Basic Happy Path', () => {
applicationDetailPage.openBuildLog(componentName);
applicationDetailPage.verifyBuildLogTaskslist(piplinerunlogsTasks); //TO DO : Fetch the piplinerunlogsTasks from cluster using api At runtime.
applicationDetailPage.verifyFailedLogTasksNotExists();
applicationDetailPage.checkBuildLog('show-summary', 'Image is in : quay.io');
applicationDetailPage.checkBuildLog('push-dockerfile', 'Selecting auth for quay.io');
applicationDetailPage.closeBuildLog();
});
});
Expand Down

0 comments on commit f7a700f

Please sign in to comment.