Skip to content

Commit

Permalink
Add various small improvements to the smoke test
Browse files Browse the repository at this point in the history
Some small tweaks:
* Log the browser version for reference
* Use waitForSelector, which is future-compatible with modern Puppeteer
* Use a more reasonable viewport size for easier headful debugging
* Switch to localhost to match our normal dev flow
  • Loading branch information
pimterry committed Feb 1, 2024
1 parent 3978eb5 commit 8aaadeb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/integration/smoke-test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,16 @@ describe('Smoke test', function () {
[ browser, server ] = await Promise.all([
puppeteer.launch({
headless: true,
defaultViewport: { width: 1280, height: 1024 },
slowMo: 0,
timeout: 10000,
args: ['--no-sandbox']
}),
startServer(),
startWebServer()
]);

console.log(`Testing with browser ${await browser.version()}`);
});

afterEach(async () => {
Expand All @@ -56,9 +59,9 @@ describe('Smoke test', function () {

it('can load the app', async () => {
const page = await browser.newPage();
await page.goto('http://local.httptoolkit.tech:7654');
await page.goto('http://localhost:7654');

await page.waitFor('h1');
await page.waitForSelector('h1');
const heading = await page.$eval('h1', (h1) => h1.innerHTML);

expect(heading).to.equal('Intercept HTTP');
Expand Down

0 comments on commit 8aaadeb

Please sign in to comment.