question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't login with Testcafe

See original GitHub issue

What 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:

  1. Go to my website
  2. Click on the sign in
  3. Provide credentials and click sign in
  4. 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:closed
  • Created 4 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
LavrovArtemcommented, Apr 6, 2020

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?

0reactions
lock[bot]commented, May 20, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found