Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress update instructions given say to update with npm, even if you're using yarn #2871

Closed
silbinarywolf opened this issue Dec 2, 2018 · 9 comments

Comments

@silbinarywolf
Copy link
Contributor

@silbinarywolf silbinarywolf commented Dec 2, 2018

Current behavior:

When I open Cypress and there's a new update, the update instructions tell me to use npm install --save-dev cypress@3.1.2 rather than saying yarn add --dev cypress@3.1.2.

Desired behavior:

If a yarn.lock file is detected instead of a package-lock.json file, the message should given you the yarn instructions.

The location of the update code is found at:

  • packages/desktop-gui/src/update/update-banner.jsx

The location of the code that tests the update banner:

  • integration/update_banner_spec.coffee

Steps to reproduce:

I assume you should be able install Cypress 3.1.1, run it with ``cypress open` and see the update button / with instructions.

Versions

  • 3.1.1

Operating System

Windows 10

@louise-hayes
Copy link
Contributor

@louise-hayes louise-hayes commented Feb 8, 2019

Could I take this issue?

@flotwig
Copy link
Member

@flotwig flotwig commented Feb 8, 2019

@louise-hayes Absolutely!

@louise-hayes
Copy link
Contributor

@louise-hayes louise-hayes commented Feb 8, 2019

Have reproduced error as per notes above, on MAC Sierra 10.12.6
screen shot 2019-02-08 at 14 16 22

@louise-hayes
Copy link
Contributor

@louise-hayes louise-hayes commented Feb 20, 2019

Hi!
I have added code to check for yarn.lock but the file check is always 'null', because the yarn.lock is not accessible to cypress during the test run phase.

Below are the screen shots, to show my progress. I attached the folders and file that cypress sees when running the tests, and also the code I have changed on my repo.

If you agree that the file yarn.lock is not accessible, as I believe, and we cannot check for it in the way I am trying:
Would it be a good idea / possible to change the code in another location, during the build, to set a flag/marker which would check and show if the yarn file exists - So that this yarn file is accesible.

I am happy to do stick with this and find a solution if you think it is the right way. If anyone has any ideas how I can make this marker flag or any feedback that would be great,

Thanks!

screen shot 2019-02-19 at 22 36 05

screen shot 2019-02-19 at 22 47 16

screen shot 2019-02-19 at 22 47 57

@chrisbreiding
Copy link
Contributor

@chrisbreiding chrisbreiding commented Feb 20, 2019

The desktop-gui package is similar to a web app in a browser and doesn't have access to the user's file system. For that, it utilizes the server package.

For the update check, the desktop-gui sends an updater:check message, which is received here in the server and calls into Updater.check here. One possible solution is to check for the existence of yarn.lock in Updater.check and return with an isYarn: true|false property along with the new version.

Honestly, it might be better to just show both options in the dialog instead of trying to determine if the user is using yarn:

To update Cypress:

1. Quit this app

2. If using npm, run `npm install --save-dev cypress@3.1.5`
   
   If using yarn, run `yarn add cypress@3.1.5`

3. Run ...
@louise-hayes
Copy link
Contributor

@louise-hayes louise-hayes commented Feb 20, 2019

Thanks I will implement option B, add a second message for yarn and then push that to repo for now.

louise-hayes added a commit to louise-hayes/cypress that referenced this issue Feb 22, 2019
louise-hayes added a commit to louise-hayes/cypress that referenced this issue Feb 22, 2019
louise-hayes added a commit to louise-hayes/cypress that referenced this issue Feb 22, 2019
@cypress-bot
Copy link

@cypress-bot cypress-bot bot commented Feb 25, 2019

The code for this is done in cypress-io/cypress#3563, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

jennifer-shehane added a commit that referenced this issue Feb 25, 2019
* closes #2871

* closes #2871

* lowercase Run to run since in middle of sentence


Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
@jennifer-shehane
Copy link
Member

@jennifer-shehane jennifer-shehane commented Mar 3, 2020

Released in 3.2.0

@jennifer-shehane
Copy link
Member

@jennifer-shehane jennifer-shehane commented Mar 3, 2020

This issue will be closed to further comment as the exact issue here was resolved and tested.

If you're experiencing a bug similar to this in Cypress, please open a new issue with a fully reproducible example that we can run. There may be a specific edge case with the issue that we need more detail to fix.

@cypress-io cypress-io locked as resolved and limited conversation to collaborators Mar 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

5 participants