Skip to content

Commit

Permalink
fix(ui): Style of 'Waiting for browser login' button (#8269)
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-shehane committed Aug 13, 2020
1 parent 0d8e617 commit cb19f77
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 13 deletions.
2 changes: 1 addition & 1 deletion circle.yml
Expand Up @@ -770,7 +770,7 @@ jobs:
PERCY_PARALLEL_TOTAL=1 \
yarn percy exec -- \
yarn cypress:run \
--spec cypress/integration/settings_spec.js,cypress/integration/specs_list_spec.js,cypress/integration/runs_list_spec.js
--spec cypress/integration/settings_spec.js,cypress/integration/specs_list_spec.js,cypress/integration/runs_list_spec.js,cypress/integration/login_spec.js
working_directory: packages/desktop-gui
- verify-mocha-results
# we don't really need any artifacts - we are only interested in visual screenshots
Expand Down
37 changes: 27 additions & 10 deletions packages/desktop-gui/cypress/integration/login_spec.js
Expand Up @@ -2,7 +2,7 @@ describe('Login', function () {
beforeEach(function () {
cy.fixture('user').as('user')

return cy.visitIndex().then(function (win) {
cy.visitIndex().then(function (win) {
let start = win.App.start

this.win = win
Expand Down Expand Up @@ -50,6 +50,8 @@ describe('Login', function () {

it('has dashboard login button', function () {
cy.get('.login').contains('button', 'Log In to Dashboard')

cy.percySnapshot()
})

it('opens dashboard on clicking \'Cypress Dashboard\'', () => {
Expand All @@ -75,21 +77,26 @@ describe('Login', function () {
})
})

it('disables login button', () => {
it('shows spinner with Opening browser and disables button', () => {
cy.get('@loginBtn').should('be.disabled')
})
.invoke('text').should('contain', 'Opening browser...')

it('shows spinner with Opening browser', () => {
cy.get('@loginBtn').invoke('text').should('contain', 'Opening browser...')
cy.percySnapshot()
})

context('on begin:auth', function () {
beforeEach(function () {
cy.get('@loginBtn')
})
it('when browser opened, shows spinner with Waiting...', function () {
this.onAuthMessageCb(null, {
name: '',
message: '',
stack: '',
browserOpened: true,
})

cy.get('@loginBtn').should('be.disabled')
.invoke('text').should('contain', 'Waiting for browser login...')

it('displays spinner with Opening browser... and disables button', function () {
cy.contains('Opening browser...').should('be.disabled')
cy.percySnapshot()
})

describe('on ipc begin:auth success', function () {
Expand All @@ -107,6 +114,8 @@ describe('Login', function () {

it('displays username in success dialog', () => {
cy.get('.modal').contains('Jane Lane')

cy.percySnapshot()
})

it('can close modal by clicking Continue', () => {
Expand Down Expand Up @@ -159,6 +168,8 @@ describe('Login', function () {
it('displays error in ui', () => {
cy.get('.alert-danger').should('be.visible')
.contains('There\'s an error')

cy.percySnapshot()
})

it('login button should be enabled', () => {
Expand All @@ -177,6 +188,8 @@ describe('Login', function () {
it('displays warning in ui', () => {
cy.get('.warning').should('be.visible')
.contains('some warning here')

cy.percySnapshot()
})

it('login button should be disabled', () => {
Expand All @@ -193,6 +206,8 @@ describe('Login', function () {
cy.get('.login-content .btn-login')
.should('be.disabled')
.should('have.text', ' Could not open browser.')

cy.percySnapshot()
})

it('<pre> can be click-selected', function () {
Expand Down Expand Up @@ -252,6 +267,8 @@ describe('Login', function () {
cy.contains('http://api.server')

cy.contains('ECONNREFUSED')

cy.percySnapshot()
})

describe('trying again', function () {
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-gui/src/auth/login-modal.jsx
Expand Up @@ -83,7 +83,7 @@ class LoginContent extends Component {
<p>You are now logged in{authStore.user ? ` as ${authStore.user.name}` : ''}.</p>
<div className='login-content'>
<button
className='btn btn-login btn-black btn-block'
className='btn btn-login btn-primary btn-wide'
onClick={close}
>
Continue
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-gui/src/auth/login.scss
Expand Up @@ -48,7 +48,7 @@
button {
display: block;
margin: 0 auto 1em;
width: 250px;
width: auto;
}

.message {
Expand Down

4 comments on commit cb19f77

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on cb19f77 Aug 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/5.0.0/linux-x64/circle-develop-cb19f77c01b6e3bba5fbbe38c18aed7c5d5962ab-420797/cypress.zip
npm install https://cdn.cypress.io/beta/npm/5.0.0/circle-develop-cb19f77c01b6e3bba5fbbe38c18aed7c5d5962ab-420788/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on cb19f77 Aug 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 ia32 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

Instructions are included below, depending on the shell you are using.

In Command Prompt (cmd.exe):

set CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/5.0.0/win32-ia32/appveyor-develop-cb19f77c01b6e3bba5fbbe38c18aed7c5d5962ab-34639805/cypress.zip
npm install https://cdn.cypress.io/beta/npm/5.0.0/appveyor-develop-cb19f77c01b6e3bba5fbbe38c18aed7c5d5962ab-34639805/cypress.tgz

In PowerShell:

$env:CYPRESS_INSTALL_BINARY = https://cdn.cypress.io/beta/binary/5.0.0/win32-ia32/appveyor-develop-cb19f77c01b6e3bba5fbbe38c18aed7c5d5962ab-34639805/cypress.zip
npm install https://cdn.cypress.io/beta/npm/5.0.0/appveyor-develop-cb19f77c01b6e3bba5fbbe38c18aed7c5d5962ab-34639805/cypress.tgz

In Git Bash:

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/5.0.0/win32-ia32/appveyor-develop-cb19f77c01b6e3bba5fbbe38c18aed7c5d5962ab-34639805/cypress.zip
npm install https://cdn.cypress.io/beta/npm/5.0.0/appveyor-develop-cb19f77c01b6e3bba5fbbe38c18aed7c5d5962ab-34639805/cypress.tgz

Using cross-env:

If the above commands do not work for you, you can also try using cross-env:

npm i -g cross-env
cross-env CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/5.0.0/win32-ia32/appveyor-develop-cb19f77c01b6e3bba5fbbe38c18aed7c5d5962ab-34639805/cypress.zip npm install https://cdn.cypress.io/beta/npm/5.0.0/appveyor-develop-cb19f77c01b6e3bba5fbbe38c18aed7c5d5962ab-34639805/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on cb19f77 Aug 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 x64 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

Instructions are included below, depending on the shell you are using.

In Command Prompt (cmd.exe):

set CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/5.0.0/win32-x64/appveyor-develop-cb19f77c01b6e3bba5fbbe38c18aed7c5d5962ab-34639805/cypress.zip
npm install https://cdn.cypress.io/beta/npm/5.0.0/appveyor-develop-cb19f77c01b6e3bba5fbbe38c18aed7c5d5962ab-34639805/cypress.tgz

In PowerShell:

$env:CYPRESS_INSTALL_BINARY = https://cdn.cypress.io/beta/binary/5.0.0/win32-x64/appveyor-develop-cb19f77c01b6e3bba5fbbe38c18aed7c5d5962ab-34639805/cypress.zip
npm install https://cdn.cypress.io/beta/npm/5.0.0/appveyor-develop-cb19f77c01b6e3bba5fbbe38c18aed7c5d5962ab-34639805/cypress.tgz

In Git Bash:

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/5.0.0/win32-x64/appveyor-develop-cb19f77c01b6e3bba5fbbe38c18aed7c5d5962ab-34639805/cypress.zip
npm install https://cdn.cypress.io/beta/npm/5.0.0/appveyor-develop-cb19f77c01b6e3bba5fbbe38c18aed7c5d5962ab-34639805/cypress.tgz

Using cross-env:

If the above commands do not work for you, you can also try using cross-env:

npm i -g cross-env
cross-env CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/5.0.0/win32-x64/appveyor-develop-cb19f77c01b6e3bba5fbbe38c18aed7c5d5962ab-34639805/cypress.zip npm install https://cdn.cypress.io/beta/npm/5.0.0/appveyor-develop-cb19f77c01b6e3bba5fbbe38c18aed7c5d5962ab-34639805/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on cb19f77 Aug 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/5.0.0/darwin-x64/circle-develop-cb19f77c01b6e3bba5fbbe38c18aed7c5d5962ab-420885/cypress.zip
npm install https://cdn.cypress.io/beta/npm/5.0.0/circle-develop-cb19f77c01b6e3bba5fbbe38c18aed7c5d5962ab-420861/cypress.tgz

Please sign in to comment.