Comments (5)
@tester-at-bmi Could you try updating to the latest Cypress version? Your issue may already be fixed.
I have to say, I haven't seen this before. This behavior doesn't occur in Chrome? Have you ensured your website doesn't have a bug in Firefox when typing outside of Cypress?
from cypress.
@tester-at-bmi Could you try updating to the latest Cypress version? Your issue may already be fixed.
I have to say, I haven't seen this before. This behavior doesn't occur in Chrome? Have you ensured your website doesn't have a bug in Firefox when typing outside of Cypress?
@jennifer-shehane On Chrome/Edge this behavior is not there when running the tests.
When i test the login manually everything is ok on firefox.
Wil report back later this week doing the test on the latest version of Cypress.
EDIT Also with the latest version of Cypress (13.6.4) i have te same issue/result.
Could it be an issue because of cy.session/cy.origin somehow where the typing is hapening?
I'm going to create another test later today that test the application itself to see if i can rule that out.
from cypress.
@jennifer-shehane 👌 so it seems that it has to do with my current setup that i provided urlier.
I tried the test directly on keycloak and that seems to work just fine.
So my best guess is it is an issue with my code that i provided that uses cy.session
/cy.origin
.
This code fails
export function loginViaGui(username: string, password: string): void {
cy.session(
[username, password],
() => {
cy.visit('/');
cy.origin(Cypress.env('BMI_AIP_KEYCLOAK'), { args: { username, password } }, ({ username, password }) => {
cy.get('#username').should('be.visible').type(username);
cy.get('#password').should('be.visible').type(password);
cy.get('#kc-login').should('be.visible').click();
});
},
{ cacheAcrossSpecs: true },
);
cy.visit('/');
cy.url().should('eq', `${Cypress.config('baseUrl')}/`);
}
So this will work.
describe('Keycloak', () => {
context('Login with valid user credentials', () => {
beforeEach('Visit login page', () => {
cy.visit('KEYCLOAK_URL');
});
describe('Should be able to login with a valid user account', () => {
it('Should be able to login with a admin account', () => {
cy.get('#username').should('be.visible').type('ADMIN');
cy.get('#password').should('be.visible').type('PASSWORD');
cy.get('#kc-login').should('be.visible').click();
});
});
});
});
from cypress.
It's a bit strange. 🤔
from cypress.
Have a workaround for the 1st part.
export function loginViaGui(username: string, password: string): void {
// eslint-disable-next-line @typescript-eslint/no-shadow
cy.session(
[username, password],
() => {
cy.visit('/');
cy.url().should('eq', `${Cypress.config('baseUrl')}/`);
cy.origin(Cypress.env('BMI_AIP_KEYCLOAK'), { args: { username, password } }, ({ username, password }) => {
//Cypress.on('uncaught:exception', () => false);
if (Cypress.isBrowser({ family: 'chromium' })) {
cy.get('#username').should('be.visible').type(username, {
log: false,
});
cy.get('#password').should('be.visible').type(password, {
log: false,
});
} else {
cy.get('#username').should('be.visible').invoke('val', username).trigger('input');
cy.get('#password').should('be.visible').invoke('val', password).trigger('input');
}
cy.get('#kc-login').should('be.visible').click();
});
},
{ cacheAcrossSpecs: false },
);
cy.visit('/');
cy.url().should('equal', `${Cypress.config('baseUrl')}/`);
cy.get(SIDEBAR_LEFT.sidebarLeft, { timeout: 5000 }).should('be.visible');
}
1st test succeeds now and session is created.
All following test fails...
The session gets restored (seems that way) and then it goes to the application url and than i'm thrown back at the origin url (should have sticked at the application url).
from cypress.
Related Issues (20)
- action commands support for web components HOT 5
- force quit HOT 4
- browser reopens after user clicks the close button HOT 1
- Tag ordering sometimes is not displayed in the order it is declared when using the --tag command in the Cypress Cloud HOT 3
- Run Timer Doesn't Stop on Run Completion on the Latest Runs Dashboard HOT 1
- With `"grepFilterSpecs": true`, video output paths are not deterministic HOT 1
- "Cypress verification failed" after upgrading to 13.6.5 with use of NX HOT 16
- Not able to use timeout with cy.xpath() HOT 1
- Cypress not opening links clicked within the Test Runner in a new tab of same browser window HOT 4
- Wrong last updated time Cypress runner UI HOT 1
- Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix") HOT 1
- Security issue: Prototype Pollution in async HOT 3
- The "paths[1]" argument must be of type string HOT 2
- Lack of separation lines between groups of functions in Cypress Runner HOT 1
- Attribute $route undefined when upgrading from 12.11.0 to 12.12.0 or higher
- In Cypress 13.6.3, I am not able to fetch the API values from the body HOT 3
- cypress not sending language in headers visitng airbnb HOT 2
- Cypress runner not able to interact with an image HOT 1
- 503 Service Temporarily Unavailable HOT 1
- Cypress cannot interpret multiple arguments on the command line to change viewports, when there are already viewports configured by default HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cypress.