Skip to content

Instantly share code, notes, and snippets.

@jennifer-shehane
Last active February 26, 2020 07:47
Show Gist options
  • Save jennifer-shehane/8a819d831efd7d82b4714d286ef2bde5 to your computer and use it in GitHub Desktop.
Save jennifer-shehane/8a819d831efd7d82b4714d286ef2bde5 to your computer and use it in GitHub Desktop.
Jennifer's GitHub Saved Replies for Cypress Repos

+ New issue in docs

I created a new issue in our docs to document {{THING TO DOCUMENT}} here: {{LINK TO ISSUE}}. Our documentation is open source and contributions are welcome. 😄

+ New issue in recipes

I created a new issue in our example recipes repo to add a new recipe for {{THING TO DOCUMENT}} here: {{LINK TO ISSUE}}. Our example recipes are open source and contributions are welcome. 😄

+ Add to plugins

Could you open a pull request to add this plugin to our documentation? Thanks! Instructions here.

Check out chat

Also, check out our community chat, it can be helpful for debugging or answering questions on how to use Cypress.

Closing - alias in before hook

before code is only run once, and between the tests Cypress removes all of the aliases. So in subsequent tests it is not available.

Moving this code into a beforeEach will work.

Duplicate of #665

Closing - content-type null

Cypress often takes the route of being more opinionated than other testing tools. Part of what we're trying to do is catch errors in your application that you may not find otherwise. We do not take a strategy of guessing the MIME type as some browsers do, so what you are experiencing is the intended behavior. There are many reasons for this that you can read here: https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Configuring_server_MIME_types

We suggest you do not send a null MIME type from your server as, according to the HTTP specification, browsers have no way of knowing how you intend for them to display and process your content.

We will be closing this issue as we do not intend to change Cypress behavior in this situation.

Closing - dashboard

You can express interest and see progress for this feature on our Roadmap from our Dashboard's product board here: https://portal.productboard.com/cypress-io/1-cypress-dashboard

I will be closing this issue and closing it to all comments since this is related to our Dashboard.

All related work for Dashboard features is handled in that ProductBoard and will be addressed by the Dashboard team directly when you comment there. We have already noted the initial comments from this issue there. Please refer all future comments there. Thank you.

Closing - inactivity

Unfortunately we have to close this issue due to inactivity. Please comment if there is new information to provide concerning the original issue and we can reopen.

Closing - issue template not filled in

When opening an issue, please fill out the issue template provided - it requires necessary information we need to help you, like desired behavior, a reproducible example and the version of Cypress you are using.

This issue will be closed as per our contributing guidelines. Please comment in this issue with the required information from our issue template and we will consider reopening the issue.

Closing - not enough info to reproduce

Unfortunately we have to close this issue as there is not enough information to reproduce the problem. This does not mean that your issue is not happening - it just means that we do not have a path to move forward.

Please comment in this issue with a reproducible example and we will consider reopening the issue.

Closing - not in feature scope

Adding this feature is not something we see as within our scope of feature work, so we will be closing this issue. We will reconsider and reopen if we see this issue gains more 👍 or comments in support.

Closing - question should be asked in Chat

Issues in our GitHub repo are reserved for potential bugs or feature requests. This issue will be closed since it appears to be neither a bug nor a feature request.

We recommend questions relating to how to use Cypress be asked in our community chat. Also try searching our existing GitHub issues, reading through our documentation, or searching Stack Overflow for relevant answers.

Closing - resolved

Closing as resolved.

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.

Closing - wrong repo

This repo is only for issues relating to Cypress [[THING HERE]]. If you want to open an issue on our main project, you can open it here. This issue will be closed in this repository.

Also, check out our community chat, it can be helpful for debugging issues or just answering questions you have about Cypress.

Code done, pending release

The code for this is done, but this has yet to be released. We'll update this issue and reference the changelog when it's released.

Dashboard Productboard

You can express interest in this feature and see it's progress on our Roadmap from our Dashboard's new product board here: https://portal.productboard.com/cypress-io/1-cypress-dashboard

Do not comment for updates

Please do not comment asking for updates

Please refrain from commenting asking for updates 🙏

  1. It creates noise for other people watching progress here.
  2. It takes the team's focus away from working on the PR.
  3. You can find ALL current updates by scrolling to the bottom of the linked PR: cypress-io/cypress#4628

Lock convo - resolved

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.

Outage

We were experiencing a brief outage of our download service that has since been resolved. You can monitor our status and review any outages in the future here: https://status.cypress.io/

PR - CLA author does not match commit author

Thanks for signing the CLA, unfortunately the author of the commits does not match the email address on your GitHub account. Our CLA bot gets confused when they don't match. Here are some solutions to fixing when commits are linked to the wrong user: https://help.github.com/articles/why-are-my-commits-linked-to-the-wrong-user/

PR - CLA signature needed

Thanks for the contribution! Could you please sign our CLA?

PR - Closing - Dep update

Closing this PR since we use renovate to manage our updates - and use set versions as noted in our Contributing guide. I'll trigger the automated PR to run through renovate.

PR - Closing - Inactivity

Do you still have time to address the changes requested in this PR? We will have to close this PR due to inactivity otherwise.

PR - Needs tests

Thanks for the contribution! We will need some tests written to verify this new behavior.

There is a Contributing Guide that covers how to contribute and get Cypress running locally here: https://github.com/cypress-io/cypress/blob/develop/.github/CONTRIBUTING.md

Let us know if you have trouble getting the tests running locally.

PR - Needs tests (cli)

We will need some tests written to verify this new behavior.

There is a Contributing Guide that covers how to contribute and get Cypress running locally in generally here: https://github.com/cypress-io/cypress/blob/develop/.github/CONTRIBUTING.md

Instructions for running the cli tests can be found here: https://github.com/cypress-io/cypress/blob/develop/cli/README.md

Let us know if you have trouble getting the tests running locally.

PR - Needs tests (desktop-gui)

We will need some tests written to verify this new behavior.

There is a Contributing guide that covers how to contribute and get Cypress running locally in generally here: https://github.com/cypress-io/cypress/blob/develop/.github/CONTRIBUTING.md

To run the tests:

  • within cypress root, run yarn
  • cd to cypress/packages/desktop-gui and run yarn watch
  • In cypress/packages/desktop-gui run yarn cypress:run
  • click on the test you're writing to run it within Cypress

Instructions for running the desktop-gui tests can always be found here: https://github.com/cypress-io/cypress/blob/develop/packages/desktop-gui/README.md

PR - Needs tests (driver)

Thanks! Can you add a test around this new behavior?

There is a Contributing Guide that covers how to contribute and get Cypress running locally in generally here: https://github.com/cypress-io/cypress/blob/develop/.github/CONTRIBUTING.md

Here's an example of another issue's test code:

To run the tests:

  • within cypress root, run yarn
  • cd to cypress/packages/runner and run yarn watch
  • cd to cypress/packages/driver and run yarn cypress:open
  • click on the test you're writing to run it within Cypress

Instructions for running the driver tests can always be found here: https://github.com/cypress-io/cypress/blob/develop/packages/driver/README.md

PR - Template required

When opening a pull request, please fill out the pull request template provided - it requires necessary information we need to move forward with reviewing pull requests.

If you can, please edit the initial comment of this PR filling out the pull request template including an explanation for why this PR is necessary. Otherwise, we will be closing this PR.

Prioritize Issue

We prioritize issues we work on based on a variety of factors - including the number of users requesting/helped by a feature. While this is still on our Roadmap, many other features are a higher priority today as a result of this assessment. Sorry for the delay. 🙏

Record key exposed

You should not share your record key in a public place. There are reasons why this key should be kept secret as explained here: https://on.cypress.io/projects#Record-key

We strongly advise that you regenerate a new key since you have exposed your private record key. Instructions here: https://on.cypress.io/projects#Create-new-record-key

Stage - Still in proposal stage

This issue is still in the 'proposal' stage, which means no work has been done on this issue as of today, so we do not have an estimate on when this will be delivered.

Triage - CI diff from local

Tests run in CI run within the Electron browser. So, the first suggestion is to run the tests locally within the Electron browser with DevTools open to see if there are any issues there.

Since you already mentioned running the tests locally with other browser combinations, next I would make sure that video recording and/or screenshots are turned on during the CI run. Review the video to see if anything can be detected there that is causing the failure.

If it's still not obvious, compare the Command Log from within the video to the Command Log of the same test passing locally when run in Cypress. Take a screenshot of each at the same moment and compare each command side by side. Seeing differences of the execution time or missing commands, etc can sometimes illuminate differences in the timings of requests or other methods that may have caused an issue.

Triage - Clear App Data

Could you try following these instructions to Clear App Data?

Triage - Cypress update first

I see that you are using an older version of Cypress. Please update to the current version of Cypress and let us know if this is still happening for you. Your issue may have already been fixed. Thanks!

Triage - Cypress version cached

We've identified an issue where if your website is using service worker cache, then the old version of Cypress may continue to run against your tests when locally opened in the newer version. (Issue to be detailed soon)

Could you please follow these instructions to clear App Data and restart Cypress? We believe this should clear the cached version of Cypress and run your tests against the new version again.

Please let us know the results!

Triage - DEBUG logs

Could you run Cypress in debug mode mode and print the entire set of logs here?

Triage - Flaky tests in CI

Most often in cases of flaky tests, we see that there is not enough assertions surrounding the actions or XHR requests/responses necessary before moving on to the next assertion. So if there is any variation in the speed of the XHR requests response in interactive mode versus run mode, then there will start to be failures in one over the other - or flaky tests.

One of our engineers, Gleb, wrote a great blog post about this you can read here: https://www.cypress.io/blog/2019/01/22/when-can-the-test-click/

My best debugging tip is to get a screenshot/video of the Command Log while running in CI on the flaky failed test and compare this to a screenshot/video of the Command Log while running locally - anywhere you see that it does not match exactly, look into that - may be a request returned slower or the order of how your app responded slightly changed.

Yes - Open PR

Yes we would love an open PR - even one that is a work in progress is fine. Check out our contributing doc and ask us if you get stuck.

Triage - modifyObstructiveCode

Your application may be using "frame busting". By default Cypress modifies code it detects as frame busting so the application under test runs properly in the Cypress Test Runner (which runs your app inside an iframe itself). Can you try disabling this by setting modifyObstructiveCode=false in your configuration? Further explanation can be found here: https://on.cypress.io/configuration#modifyObstructiveCode

Triage - Network issue

Can you access the domain normally, via curl within your environment? What is the result of running curl yourdomain.com? Can you access the domain via a normal Node http.request within the environment? Knowing the results of these will help narrow down if this is a network issue inside or outside of Cypress.

Triage - Run in brand new project

Just to narrow down the possible causes, could you just run Cypress in a brand new project? So:

mkdir my-project
cd my-project
npm init -f
npm install --save-dev cypress
./node_modules/.bin/cypress open

Triage - Run in Electron

Can you run the tests in cypress open and choose Electron as the browser to run within? See if the tests are failing there. Make sure to open the developer tools to see any errors in the console.

Triage - Run with --browser chrome

Can you try running the tests in CI passing --browser chrome? This will launch the tests within a Chrome browser detected on your machine. I'd like to narrow does if this is an issue isolated to the Electron browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment