From ef5210b399f7bf13ebe358f6963e25e60c7eb40b Mon Sep 17 00:00:00 2001 From: Alan Greene Date: Tue, 3 Jan 2023 17:34:53 +0000 Subject: [PATCH] Update e2e to remove unnecessary use of parent() Target the `a` element specifically to avoid potential issue where Cypress finds a `span` containing the target text and clicks it (which does nothing, matching the behaviour seen in failure videos) instead of waiting for it to become a link. --- .../e2e/cypress/e2e/run/create-pipelinerun.cy.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/e2e/cypress/e2e/run/create-pipelinerun.cy.js b/packages/e2e/cypress/e2e/run/create-pipelinerun.cy.js index 1e2fc714d..4308f12f4 100644 --- a/packages/e2e/cypress/e2e/run/create-pipelinerun.cy.js +++ b/packages/e2e/cypress/e2e/run/create-pipelinerun.cy.js @@ -1,5 +1,5 @@ /* -Copyright 2022 The Tekton Authors +Copyright 2022-2023 The Tekton Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -64,7 +64,8 @@ spec: cy.contains('button', 'Create').click(); - cy.contains(`${pipelineName}-run`).parent().click(); + cy.contains('h1', 'PipelineRuns'); + cy.contains('a', `${pipelineName}-run`).click(); cy.get('header[class="tkn--pipeline-run-header"]') .find('span[class="tkn--status-label"]', { timeout: 15000 }) @@ -118,7 +119,8 @@ spec: cy.contains('button', 'Create').click(); - cy.contains(pipelineRunName).parent().click(); + cy.contains('h1', 'PipelineRuns'); + cy.contains('a', pipelineRunName).click(); cy.get('header[class="tkn--pipeline-run-header"]') .find('span[class="tkn--status-label"]', { timeout: 15000 }) @@ -156,7 +158,8 @@ spec: cy.contains('button', 'Create').click(); - cy.get(`[title=${pipelineRunName}]`).parent().click(); + cy.contains('h1', 'PipelineRuns'); + cy.get(`[title=${pipelineRunName}]`).click(); cy.get('header[class="tkn--pipeline-run-header"]') .find('span[class="tkn--status-label"]', { timeout: 15000 }) @@ -191,7 +194,8 @@ spec: cy.contains('button', 'Create').click(); - cy.get(`[title=${pipelineRunName}]`).parent().click(); + cy.contains('h1', 'PipelineRuns'); + cy.get(`[title=${pipelineRunName}]`).click(); cy.get('header[class="tkn--pipeline-run-header"]') .find('span[class="tkn--status-label"]', { timeout: 15000 })