Skip to content

Commit

Permalink
Update e2e to remove unnecessary use of parent()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AlanGreene authored and tekton-robot committed Jan 4, 2023
1 parent 5108e1b commit ef5210b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/e2e/cypress/e2e/run/create-pipelinerun.cy.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 })
Expand Down Expand Up @@ -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 })
Expand Down Expand Up @@ -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 })
Expand Down Expand Up @@ -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 })
Expand Down

0 comments on commit ef5210b

Please sign in to comment.