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 log in to app under test

See original GitHub issue

Current behavior:

My app’s login component will not let me log in when opened with the Cypress browser. I can log in via the normal Chrome browser. Copypasting the username and password which work in the normal browser to the Cypress browser ralso esults in a login error.

Desired behavior:

Valid credentials should let me log in.

Steps to reproduce:

Cypress test:

describe('Logging in', () => {
	it('Logs in as admin', () => {
		cy.visit('/')
            .get('input[type="text"]')
            .type('Admin')
		    .get('input[type="password"]')
            .type('Pass1234')
            .get('button').click()
		    .location().should((loc) => {
			expect(loc.pathname).to.eq('/dashboard-main/dashboard');
		})
	})
})

Login component (Vue):

<template>
    <div class="d-flex justify-content-center">
        <div v-if="isAuthenticated" class="text-center">
            <div>Hello, authenticated user!</div>
            <button v-on:click="logout()" class="button is-primary">Logout</button>
        </div>
        <div v-else>
            <div class="field is-horizontal">
                <div class="field-label is-normal">
                    <label class="label">Username</label>
                </div>
                <div class="field-body">
                    <div class="field">
                        <div class="control">
                            <input v-model="username" class="input" type="text"
                                   placeholder="Your username">
                        </div>
                    </div>
                </div>
            </div>
            <div class="field is-horizontal">
                <div class="field-label is-normal">
                    <label class="label">Password</label>
                </div>
                <div class="field-body">
                    <div class="field">
                        <div class="control">
                            <input v-model="password" class="input" type="password"
                                   placeholder="Your password">
                        </div>
                    </div>
                </div>
            </div>
            <div class="field is-horizontal">
                <div class="field-label">
                    <!-- Left empty for spacing -->
                </div>
                <div class="field-body">
                    <div class="field">
                        <div class="control text-center">
                            <button v-on:click="login()" class="button is-primary">
                                Login
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

Versions

Cypress: ^2.1.0 OS: Windows 10 Browser: Chrome 66.0.3359.139

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:38 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
mohammedroni4commented, May 17, 2019

Not sure, I do not know whats going on, it seems to be priority for most of us I think now.

1reaction
modulitoscommented, Jun 27, 2018

@boriskogan81 Wow, thank you so much! I prefixed a DEBUG=cypress:* to my cypress open command, and the login process works! If you think this is the proper solution, feel free to close the issue.

Update: This actually doesn’t fix my issue. The bug I posted above seems to occur non-deterministically, so prefixing a DEBUG=cypress:* seemed to fix it, but it was only temporary and perhaps a coincidence.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't log in to sandbox to test in… | Apple Developer Forums
I'm trying to test in-app purchase. I have logged out of my account on the phone. When I try to make the purchase,...
Read more >
Unable to log in with sandbox test users on device
LOG OUT of ITUNES/APP STORE so that no account is in the apple ID in settings and then just run your app &...
Read more >
I am not able to sign-in to App Store or TestFlight with my ...
OR open the Testflight App, and click 'Continue' to view and test your iOS Apps.
Read more >
Why I can't sign into App Store or TestFlight with my Apple ID?
Below are the steps to sign in to App Store or TestFlight with your Apple ID: Go to the App Store and click...
Read more >
Can't log in as test user for IAP development - Oculus Forum
I used the instructions below and my bullet points correspond to theirs. 1. I do not see "Settings > Device > Users" anywhere...
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