diff --git a/e2e/cypress/e2e/operator.cy.js b/e2e/cypress/e2e/operator.cy.js
index 61296df0..6b5bb388 100644
--- a/e2e/cypress/e2e/operator.cy.js
+++ b/e2e/cypress/e2e/operator.cy.js
@@ -14,7 +14,7 @@ describe('Operator', function () {
describe('updating operator profile', function () {
beforeEach(function () {
- cy.get('a').contains('My account').click();
+ cy.get('div[role=button]').contains('My account').click();
cy.get('a').contains('Producer profile').click();
cy.location('pathname', {timeout: 25000}).should('include', '/operator/edit');
})
@@ -50,7 +50,7 @@ describe('Operator', function () {
describe('documentation', function () {
beforeEach(function () {
- cy.get('a').contains('My account').click();
+ cy.get('div[role=button]').contains('My account').click();
cy.contains('a', 'IFO / Interholco').click();
cy.location('pathname', {timeout: 25000}).should('include', '/documentation');
})
diff --git a/e2e/cypress/e2e/pages.cy.js b/e2e/cypress/e2e/pages.cy.js
index 051171a3..488608a1 100644
--- a/e2e/cypress/e2e/pages.cy.js
+++ b/e2e/cypress/e2e/pages.cy.js
@@ -2,7 +2,7 @@ describe('Pages', () => {
describe('Login page', () => {
it('matches visually', function () {
cy.visit('/');
- cy.get('a').contains('Sign in').click();
+ cy.get('div[role=button]').contains('Sign in').click();
cy.get('.c-login').matchImage();
});
})
diff --git a/e2e/cypress/e2e/password-reset.cy.js b/e2e/cypress/e2e/password-reset.cy.js
index 168e9265..b7eb0a29 100644
--- a/e2e/cypress/e2e/password-reset.cy.js
+++ b/e2e/cypress/e2e/password-reset.cy.js
@@ -5,7 +5,7 @@ describe('Password Reset', () => {
describe('Forgot password form', () => {
it('user can ask for password reset', function () {
- cy.get('a').contains('Sign in').click();
+ cy.get('div[role=button]').contains('Sign in').click();
cy.get('button').contains('Reset your password').click();
cy.get('#input-email').type('operator@example.com');
cy.get('button').contains('Reset Password').click();
diff --git a/e2e/cypress/e2e/user.cy.js b/e2e/cypress/e2e/user.cy.js
index 1321d3ad..98148b25 100644
--- a/e2e/cypress/e2e/user.cy.js
+++ b/e2e/cypress/e2e/user.cy.js
@@ -10,33 +10,33 @@ describe('User', () => {
context('Login form', () => {
it('can log in', function () {
cy.visit('/');
- cy.get('a').contains('Sign in').click();
+ cy.get('div[role=button]').contains('Sign in').click();
cy.get('#input-email').type('operator@example.com');
cy.get('#input-password').type('wrongpassword');
cy.get('button').contains('Log in').click();
cy.get('.rrt-text').should('have.text', 'Wrong email or password');
cy.get('#input-password').clear().type('Supersecret1');
cy.get('button').contains('Log in').click();
- cy.contains('a', 'My account');
+ cy.contains('div[role=button]', 'My account');
});
})
context('Public user', () => {
it('can log in and out', function () {
cy.login('operator@example.com', 'Supersecret1');
- cy.get('a').contains('My account').click();
+ cy.get('div[role=button]').contains('My account').click();
cy.get('a').contains('My profile').click();
cy.get('#input-firstName').should('have.value', 'Operator');
cy.get('#input-lastName').should('have.value', 'User');
- cy.get('a').contains('My account').click();
+ cy.get('div[role=button]').contains('My account').click();
cy.get('a').contains('Sign out').click();
- cy.get('a').contains('Sign in').should('exist')
- cy.get('a').contains('My account').should('not.exist')
+ cy.get('div[role=button]').contains('Sign in').should('exist')
+ cy.get('div[role=button]').contains('My account').should('not.exist')
});
it('can create account', function () {
cy.visit('/');
- cy.get('a').contains('Sign in').click();
+ cy.get('div[role=button]').contains('Sign in').click();
cy.get('a').contains('Register now').click();
cy.selectOption('[name=country_id]', 'Co', 'Congo');
cy.selectOption('[name=operator_id]', 'Si', 'SIFCO');
@@ -62,7 +62,7 @@ describe('User', () => {
it('can create producer', function () {
cy.visit('/');
- cy.get('a').contains('Sign in').click();
+ cy.get('div[role=button]').contains('Sign in').click();
cy.get('a').contains('Register new producer').click();
cy.get('#input-name').type('Super New Producer');
@@ -88,7 +88,7 @@ describe('User', () => {
});
it('can update user profile', function () {
- cy.get('a').contains('My account').click();
+ cy.get('div[role=button]').contains('My account').click();
cy.get('a').contains('My profile').click();
cy.get('#input-firstName').clear();
diff --git a/e2e/cypress/support/commands.js b/e2e/cypress/support/commands.js
index 3a708a85..910fe9ee 100644
--- a/e2e/cypress/support/commands.js
+++ b/e2e/cypress/support/commands.js
@@ -15,11 +15,11 @@ Cypress.Commands.add('login', (username, password) => {
[username, password],
() => {
cy.visit('/');
- cy.get('a').contains('Sign in').click();
+ cy.get('div[role=button]').contains('Sign in').click();
cy.get('#input-email').type(username);
cy.get('#input-password').type(password);
cy.get('button').contains('Log in').click();
- cy.get('a').contains('My account').should('exist');
+ cy.get('div[role=button]').contains('My account').should('exist');
},
{
cacheAcrossSpecs: true