Can't login with Testcafe
See original GitHub issueWhat is your Test Scenario?
Login to the application
What is the Current behavior?
Test cafe cannot login to the app
What is the Expected behavior?
Login works fine outside testcafe.
What is your web application and your TestCafe test code?
Given you the access via support email
Steps to Reproduce:
- Go to my website
- Click on the sign in
- Provide credentials and click sign in
- Check the error on top(cannot login this time). This happens only when running tests via testcafe.
Your Environment details:
- testcafe version: 1.5.0
- node.js version: 10.16.0
- browser name and version: chrome 77
- platform and version: macOS
Your website URL (or attach your complete example):
Your complete test code (or attach your test files):
export const roleCFC = Role('XXXXX', async t => {
await t
.click(Selector('.button.signIn'))
.typeText(Selector('input').withAttribute('name','email'),'XXXX')
.typeText(Selector('input').withAttribute('name','password'),'XXXX')
.click(Selector('span.auth0-label-submit'))
}, { preserveUrl: true });
import { Selector, RequestLogger } from 'testcafe';
import {roleCFC} from '../../roles/roles'
fixture `CFC TestCafe POC`
test('Login to app', async t => {
await t
await t.useRole(roleCFC)
await t.debug()
await t.wait(10000)
});
const createTestCafe = require('testcafe');
let testcafe = null;
let runner = null;
const reporters = [
{
"name" :'spec'
},
/*{
"name": 'slack',
"output": "reports/slack.json"
}*/
]
createTestCafe('localhost', 1337, 1338)
.then(tc => {
testcafe = tc;
runner = testcafe.createRunner();
return runner
.src('./tests/cfc/cfc.js')
.browsers(['chrome'])
.reporter(reporters)
.run();
})
.then(failedCount => {
console.log('Tests failed: ' + failedCount);
testcafe.close();
})
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Authentication and Roles | Advanced Guides - TestCafe
If your log-in fails and you receive no cookies, subsequent Role activations will not authenticate the user and will yield test errors. HTTP...
Read more >How Testcafe handle login errors? - Stack Overflow
I'm testing a website that needs authentication with different users. It's working most of the time but sometimes, login fails and Testcafé ......
Read more >Unable to automate Social Media login with TestCafe ... - GitHub
Currently TestCafe opens it in the existing window. Once valid login details have been supplied the page just hangs on a blank page....
Read more >A page hangs at login in TestCafe Studio 1.3.0
Hello - the first stage of my tests has a log in with email address and password. These tests were working before I...
Read more >End-to-End Testing with TestCafe Book Excerpt: User Roles
Learn about TestCafe's built-in roles mechanism to handle authentication, and how it can help you organize and speed up your end-to-end ...
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
Hello @rahulrana1,
Data privacy is our top priority. For safety reasons, we did not save your data after our last attempt to find the cause of the issue. Could you please resend it?
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.