diff --git a/frontend/src/__tests__/cypress/cypress/pages/pipelines/topology.ts b/frontend/src/__tests__/cypress/cypress/pages/pipelines/topology.ts index 71ae45fcac..81a324303a 100644 --- a/frontend/src/__tests__/cypress/cypress/pages/pipelines/topology.ts +++ b/frontend/src/__tests__/cypress/cypress/pages/pipelines/topology.ts @@ -98,10 +98,10 @@ class RunDetails extends PipelinesTopology { return new DetailsItem(() => cy.findByTestId(`detail-item-${key}`)); } - private findStatusLabel(timeout: number = 180000) { + private findStatusLabel(timeout = 180000) { return cy.get( 'h1[data-testid="app-page-title"] .pf-v5-l-split__item:last-child .pf-v5-c-label__text', - { timeout: timeout } + { timeout }, ); } diff --git a/frontend/src/__tests__/cypress/cypress/tests/e2e/pipelines/pipelines.cy.ts b/frontend/src/__tests__/cypress/cypress/tests/e2e/pipelines/pipelines.cy.ts index 64650e799f..aadb00f737 100644 --- a/frontend/src/__tests__/cypress/cypress/tests/e2e/pipelines/pipelines.cy.ts +++ b/frontend/src/__tests__/cypress/cypress/tests/e2e/pipelines/pipelines.cy.ts @@ -12,7 +12,10 @@ import { pipelineImportModal } from '~/__tests__/cypress/cypress/pages/pipelines import { pipelinesGlobal } from '~/__tests__/cypress/cypress/pages/pipelines/pipelinesGlobal'; import { pipelinesTable } from '~/__tests__/cypress/cypress/pages/pipelines/pipelinesTable'; import { createRunPage } from '~/__tests__/cypress/cypress/pages/pipelines/createRunPage'; -import { pipelineDetails, pipelineRunDetails } from '~/__tests__/cypress/cypress/pages/pipelines/topology'; +import { + pipelineDetails, + pipelineRunDetails, +} from '~/__tests__/cypress/cypress/pages/pipelines/topology'; const projectName = 'test-pipelines-prj'; const dspaSecretName = 'dashboard-dspa-secret'; @@ -38,9 +41,7 @@ describe('An admin user can import and run a pipeline', { testIsolation: false } AWS_DEFAULT_REGION: Buffer.from(AWS_BUCKETS.BUCKET_2.REGION).toString('base64'), AWS_S3_BUCKET: Buffer.from(AWS_BUCKETS.BUCKET_2.NAME).toString('base64'), AWS_S3_ENDPOINT: Buffer.from(AWS_BUCKETS.BUCKET_2.ENDPOINT).toString('base64'), - AWS_SECRET_ACCESS_KEY: Buffer.from(AWS_BUCKETS.AWS_SECRET_ACCESS_KEY).toString( - 'base64', - ), + AWS_SECRET_ACCESS_KEY: Buffer.from(AWS_BUCKETS.AWS_SECRET_ACCESS_KEY).toString('base64'), }; cy.fixture('resources/yaml/data_connection.yml').then((yamlContent) => { const modifiedYamlContent = replacePlaceholdersInYaml( @@ -57,9 +58,7 @@ describe('An admin user can import and run a pipeline', { testIsolation: false } DSPA_SECRET_NAME: dspaSecretName, NAMESPACE: projectName, AWS_ACCESS_KEY_ID: Buffer.from(AWS_BUCKETS.AWS_ACCESS_KEY_ID).toString('base64'), - AWS_SECRET_ACCESS_KEY: Buffer.from(AWS_BUCKETS.AWS_SECRET_ACCESS_KEY).toString( - 'base64', - ), + AWS_SECRET_ACCESS_KEY: Buffer.from(AWS_BUCKETS.AWS_SECRET_ACCESS_KEY).toString('base64'), }; cy.fixture('resources/yaml/dspa_secret.yml').then((yamlContent) => { const modifiedYamlContent = replacePlaceholdersInYaml(yamlContent, dspaSecretReplacements); @@ -88,6 +87,7 @@ describe('An admin user can import and run a pipeline', { testIsolation: false } }); it('An admin User can Import and Run a Pipeline', () => { + // Login as an admin cy.visitWithLogin('/', ADMIN_USER); @@ -98,7 +98,7 @@ describe('An admin user can import and run a pipeline', { testIsolation: false } // Open the project projectListPage.findProjectLink(projectName).click(); - + // Increasing the timeout to ~3mins so the DSPA can be loaded projectDetails.findImportPipelineButton(180000).click(); @@ -120,7 +120,7 @@ describe('An admin user can import and run a pipeline', { testIsolation: false } * Run the Pipeline using the Actions button in the pipeline detail view */ - pipelineDetails.selectActionDropdownItem("Create run"); + pipelineDetails.selectActionDropdownItem('Create run'); //Fill the Create run fields createRunPage.findExperimentSelect().click(); diff --git a/frontend/src/__tests__/cypress/cypress/utils/ocCommands.ts b/frontend/src/__tests__/cypress/cypress/utils/ocCommands.ts index d411e462bd..43d3ece6be 100644 --- a/frontend/src/__tests__/cypress/cypress/utils/ocCommands.ts +++ b/frontend/src/__tests__/cypress/cypress/utils/ocCommands.ts @@ -42,7 +42,5 @@ export const createOpenShiftProject = (projectName: string, displayName?: string */ export const deleteOpenShiftProject = (projectName: string) => { const ocCommand = `oc delete project ${projectName}`; - return cy.exec(ocCommand, { failOnNonZeroExit: false}).then(() => { - return; - }); -}; \ No newline at end of file + return cy.exec(ocCommand, { failOnNonZeroExit: false }).then(() => {}); +}; diff --git a/frontend/src/__tests__/cypress/cypress/utils/testConfig.ts b/frontend/src/__tests__/cypress/cypress/utils/testConfig.ts index 57ee30f658..4efb321c05 100644 --- a/frontend/src/__tests__/cypress/cypress/utils/testConfig.ts +++ b/frontend/src/__tests__/cypress/cypress/utils/testConfig.ts @@ -3,7 +3,12 @@ import path from 'path'; import { env } from 'process'; import dotenv from 'dotenv'; import YAML from 'yaml'; -import type { UserAuthConfig, TestConfig, AWSS3BucketDetails, AWSS3Buckets } from '~/__tests__/cypress/cypress/types'; +import type { + UserAuthConfig, + TestConfig, + AWSS3BucketDetails, + AWSS3Buckets, +} from '~/__tests__/cypress/cypress/types'; [ `.env.cypress${env.CY_MOCK ? '.mock' : ''}.local`, @@ -37,12 +42,14 @@ const ADMIN_USER: UserAuthConfig = testConfig?.OCP_ADMIN_USER ?? { const AWS_PIPELINES_BUCKET_DETAILS: AWSS3BucketDetails = { NAME: testConfig?.S3.BUCKET_2.NAME || env.AWS_PIPELINES_BUCKET_NAME || '', REGION: testConfig?.S3.BUCKET_2.REGION || env.AWS_PIPELINES_BUCKET_REGION || '', - ENDPOINT: testConfig?.S3.BUCKET_2.ENDPOINT || env.AWS_PIPELINES_BUCKET_ENDPOINT || '' + ENDPOINT: testConfig?.S3.BUCKET_2.ENDPOINT || env.AWS_PIPELINES_BUCKET_ENDPOINT || '', }; const AWS_PIPELINES: AWSS3Buckets = { - AWS_ACCESS_KEY_ID: testConfig?.S3.AWS_ACCESS_KEY_ID || env.AWS_PIPELINES_BUCKET_ACCESS_KEY_ID || '', - AWS_SECRET_ACCESS_KEY: testConfig?.S3.AWS_SECRET_ACCESS_KEY || env.AWS_PIPELINES_BUCKET_SECRET_ACCESS_KEY || '', - BUCKET_2: AWS_PIPELINES_BUCKET_DETAILS + AWS_ACCESS_KEY_ID: + testConfig?.S3.AWS_ACCESS_KEY_ID || env.AWS_PIPELINES_BUCKET_ACCESS_KEY_ID || '', + AWS_SECRET_ACCESS_KEY: + testConfig?.S3.AWS_SECRET_ACCESS_KEY || env.AWS_PIPELINES_BUCKET_SECRET_ACCESS_KEY || '', + BUCKET_2: AWS_PIPELINES_BUCKET_DETAILS, }; // spread the cypressEnv variables into the cypress config diff --git a/frontend/src/__tests__/cypress/test-variables.yml.example b/frontend/src/__tests__/cypress/test-variables.yml.example index 70287a0be3..0cad9a7ed0 100644 --- a/frontend/src/__tests__/cypress/test-variables.yml.example +++ b/frontend/src/__tests__/cypress/test-variables.yml.example @@ -7,9 +7,10 @@ OCP_ADMIN_USER: AUTH_TYPE: adm-auth USERNAME: adminuser PASSWORD: adminuser-passwd -AWS_PIPELINES_BUCKET: - BUCKET_NAME: bucket - AWS_ACCESS_KEY_ID: access-key - AWS_SECRET_ACCESS_KEY: secret - AWS_ENDPOINT: endpoint - AWS_REGION: region \ No newline at end of file +S3: + AWS_ACCESS_KEY_ID: access_key + AWS_SECRET_ACCESS_KEY: secret_key + BUCKET_2: + NAME: pipeline-bucket-name + REGION: pipeline-bucket-region + ENDPOINT: https://pipeline-bucket-endpoint.com/ \ No newline at end of file