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

Add End 2 End tests #477

Merged
merged 9 commits into from
Jul 18, 2018
Merged

Conversation

stefanbuck
Copy link
Member

@stefanbuck stefanbuck commented Jun 17, 2018

This is a first implementation to load the real OctoLinker browser extension in a Chrome instance using puppeteer.

I've created a separate repository which contains all the test files https://github.com/OctoLinker/e2e. End to end tests are generated on-the-fly based on the repo content so no additional PR in here is required to increase our coverage.

Before yarn e2e invokes the actual tests, it downloads https://github.com/OctoLinker/e2e/blob/master/resource.json which is used to generate our e2e tests. For more details visit https://github.com/OctoLinker/e2e

@stefanbuck stefanbuck force-pushed the integration-tests branch 3 times, most recently from 5563f63 to d8069d5 Compare June 18, 2018 21:46
@stefanbuck stefanbuck force-pushed the integration-tests branch 5 times, most recently from ec9ca26 to e30c96c Compare June 29, 2018 17:36
module.exports = {
launch: {
dumpio: true,
headless: false,
Copy link
Member Author

Choose a reason for hiding this comment

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

Puppeteer headless doesn't support extensions, right now.

puppeteer/puppeteer#2819 (comment)

@stefanbuck
Copy link
Member Author

Hi @josephfrazier 👋 Friendly reminder in case you missed my review request. I'm excited to hear feedback on this

@josephfrazier
Copy link
Member

Thanks for the reminder, I had forgotten about this one. This looks really good overall! I'm excited to see proper Chrome tests, and I've been looking for a reason to get familiar with puppeteer.

I do have one question though: Why put the e2e tests in a separate repo? It seems like that makes it harder to keep track of them, versus just keeping them here.

@stefanbuck
Copy link
Member Author

No worries, happens to me all the time 😉 Puppeteer is really amazing and defiantly something you should look into. But back to topic:

That's a good question. Initially I thought it would be good just for the sake of separating. Also I was thinking about cases were we have to replicate some special file tree structure. However, right now there is no need for this and maybe never will be. The only last thing I can think of is when it comes to test functionality related to issues or PullRequests. Such dummy issues / PR I would see in this repo.

Conclusion, I'll merge https://github.com/OctoLinker/e2e into this and we will use the e2e repo to test other GitHub related features.

@stefanbuck stefanbuck force-pushed the integration-tests branch 5 times, most recently from 72523ec to ee3a688 Compare July 4, 2018 19:25
@stefanbuck stefanbuck force-pushed the integration-tests branch 2 times, most recently from 0d0bfb5 to 4d93f0b Compare July 4, 2018 19:40
@stefanbuck stefanbuck force-pushed the integration-tests branch from 4d93f0b to 206e05a Compare July 4, 2018 19:59
@stefanbuck stefanbuck force-pushed the integration-tests branch from 206e05a to 5fbc90b Compare July 4, 2018 20:00
@stefanbuck
Copy link
Member Author

I deleted that E2E repository and merged all the files into e2e/fixtures/. On a PullRequest Puppeteer runs the test against the fork so we can verify that fixtures files are working before we merge the PR. I also added a README to explain how it works. Please free to go wild with commenting typos and other suggestions you have to make this useful for others.

Copy link
Member

@josephfrazier josephfrazier left a comment

Choose a reason for hiding this comment

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

Thanks, I think that makes it much easier to work with! I've got another question, but don't consider it to be blocking a merge :)

Instead of needing the annotations in the test files and using generate-fixtures-json, could we use jest's snapshot functionality? I realize you've put a lot of effort into the current approach, and understand if you'd prefer that instead, or would just like to switch to snapshots later in a separate change (I could look on this if so).

@stefanbuck
Copy link
Member Author

Yes, I really put a lot of thinking into it, while I had a couple days off 😉 What would you snapshots then? We don't store any information in the DOM, so I don't know what you want to snapshots.

Once #277 is resolved, we can think about snapshotting the DOM. Although we have to be really carefully what we snapshot to keep those small as possible.

@stefanbuck
Copy link
Member Author

@josephfrazier I'm going to merge this PR now. Let's keep eye on snapshot testing once #277 is complete. Are you able to review the copy in e2e/readme.md raise a fix PR if needed? That would be really awesome.

@stefanbuck stefanbuck merged commit aba7a01 into OctoLinker:master Jul 18, 2018
@stefanbuck stefanbuck deleted the integration-tests branch July 18, 2018 20:07
@josephfrazier
Copy link
Member

Sounds good, sorry I didn't respond earlier about the snapshotting. I was thinking we can use snapshots to store the expected test results, instead of using the "//": "..." "comments". Jest snapshots aren't restricted to (V)DOM objects, so it should be doable. Maybe I'll try to set it up if I find the time.

I'll take a look at the E2E readme now and suggest changes.

josephfrazier added a commit that referenced this pull request Jul 18, 2018
josephfrazier added a commit that referenced this pull request Jul 19, 2018
* Update E2E readme grammar

As requested in #477 (comment)

* Delete misleading headline
@stefanbuck stefanbuck mentioned this pull request Aug 13, 2018
@stefanbuck stefanbuck changed the title Add integration tests Add End 2 End tests Aug 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants