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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Run e2e test against github.com/OctoLinker/e2e/
  • Loading branch information
Stefan Buck committed Jun 18, 2018
commit 3b4909ab9e0ee7a42d9acca6f1103a8182433a15
29 changes: 29 additions & 0 deletions e2e/automated.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const baseUrl = 'https://github.com/OctoLinker/e2e';

async function goto(url) {
await page.goto(url);
await page.waitForSelector('.octolinker-link');

// TODO Allow annotations beyond the first line
const annotation = await page.$eval('#LC1', el => el.textContent);
const targetPath = annotation
.replace('// Should resolve to: ', '')
.replace('<root>', '');

await page.click('.octolinker-link');
await page.waitForNavigation();

await expect(page.url()).toEqual(expect.stringMatching(targetPath));
}

describe('End to End tests', () => {
// TODO scrape https://github.com/OctoLinker/e2e/ for those urls
[
`${baseUrl}/blob/master/javascript/nodejs/index.js`,
`${baseUrl}/blob/master/javascript/nodejs/gentle-resonance-3436.js`,
].forEach(url => {
it(`resolves ${url}`, async () => {
await goto(url);
});
});
});