Skip to content

Commit 4076c0a

Browse files
committed
Fix tests
1 parent d1bf0f2 commit 4076c0a

2 files changed

Lines changed: 35 additions & 4 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "Cypress check for .only in tests"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
check-cypress-only:
12+
name: "Verify no focused Cypress tests"
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: "Checkout repository"
17+
uses: actions/checkout@v4
18+
19+
- name: "Fail if Cypress tests contain .only"
20+
run: |
21+
set -euo pipefail
22+
matches=$(rg --line-number --color=never --glob '*.cy.*' --glob '*.spec.*' --fixed-strings '.only' frontend/cypress/tests || true)
23+
if [ -n "$matches" ]; then
24+
echo "Found focused Cypress tests (.only) in frontend/cypress/tests:"
25+
echo "$matches"
26+
exit 1
27+
fi

frontend/cypress/tests/main/blocks-slider-variant.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,12 @@ context('Blocks Acceptance Tests', () => {
7474
.uncheck({ force: true })
7575
.should('not.be.checked');
7676

77-
cy.get('.align-buttons button[aria-label="Right"]').click();
78-
cy.get('.align-buttons button[aria-label="Left"]').click();
77+
cy.get(
78+
'[class*="field-wrapper-flagAlign-"] .buttons button[aria-label="Right"]',
79+
).click();
80+
cy.get(
81+
'[class*="field-wrapper-flagAlign-"] .buttons button[aria-label="Left"]',
82+
).click();
7983

8084
// add 2nd slider block Override Title, Description Image.
8185
cy.get('.add-item-button-wrapper button').click();
@@ -165,10 +169,10 @@ context('Blocks Acceptance Tests', () => {
165169
.should('not.be.checked');
166170

167171
cy.get(
168-
'[class*="field-wrapper-align-"] .buttons button[aria-label="Right"]',
172+
'[class*="field-wrapper-flagAlign-"] .buttons button[aria-label="Right"]',
169173
).click();
170174
cy.get(
171-
'[class*="field-wrapper-align-"] .buttons button[aria-label="Left"]',
175+
'[class*="field-wrapper-flagAlign-"] .buttons button[aria-label="Left"]',
172176
).click();
173177

174178
// add 2nd slider block Override Title, Description Image.

0 commit comments

Comments
 (0)