Login command using the cy.origin no longer works in 10.6
See original GitHub issueCurrent behavior
Using a login command that with cy.origin and with Cypress configured to use experimentalSessionAndOrigin: true, I was previously (Cypress.10.2) able to use idaas to handle authentication. After uprading to Cypress.10.6 this resulted in the browser loading a page labelled BAD REQUEST. The console had no useful error message or details.
I’m not sure what happened here, and I’d like to be able to fix it myself as we need to be able to authenticate out test users via idaas.
Desired behavior
The Cross-origin request should be successful and I should be able to continue to navigate on the website under test.
Test code to reproduce
Cypress.Commands.add('login', (username, password, idaasEnv) => {
const args = { username, password, idaasEnv }
cy.visit(`/myidaas${idaasEnv}.onmicrosoft.com`,
onLoad: (contentWindow) => {
console.log('Login page loaded.')
})
cy.origin(`${idaasEnv}.login.mycompany.com`, { args: {username, password, idaasEnv}}, ({ username, password, idaasEnv }) => {
console.log(`idaas is ${idaasEnv}`)
Cypress.on('uncaught:exception', (err, runnable) => {
// returning false here prevents Cypress from
// failing the test
return false
})
})
.url()
.should('include', `${idaasEnv}.login.mycompany.com/myidaas${idaasEnv}.onmicrosoft.com`, { timeout: 15000 })
cy.contains('User ID', { timeout: 15000 })
cy.get('#logonIdentifier').type(username).should('have.value', user name)
cy.get('#password').type(password)
cy.get('#next').click()
cy.url().should('contain', 'qa.newModernReactBasedWebapp.mycompany.net')
});
Cypress Version
10.6.0
Node version
v16.17.0
Operating System
Windows 10 Enterprise
Debug Logs
Should/contain does not pass as the page loaded is a blank white web page with the words Bad Request.
Other
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
origin - Cypress Documentation
The cy.origin() command allows your tests to bypass this limitation. Obstructive Third Party Code. By default Cypress will search through the response ...
Read more >User is not able to "signin with Google" using Cy.origin in ...
It's working for login with github but not for Google. . .Don't know why not working for Google. I know there is solution...
Read more >An Introduction to R - The Comprehensive R Archive Network
argument; 10.5 Assignments within functions; 10.6 More advanced examples ... If a command is not complete at the end of a line, R...
Read more >College, Career, and Civic Life (C3) Framework
NOW MORE THAN EVER, students need the intellectual power to recognize ... Work on the C3 Framework began in 2010 with the de-...
Read more >cypress: Versions - Openbase
Consider using the experimental cy.session() command instead to cache and restore ... cross-origin requests will no longer immediately fail, but instead, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@anark Ooops 😅 sorry about that! You are correct. Meant for @anbeck77.
I think this comment was meant for @anbeck77 not me