Skip to content

Commit

Permalink
fix: smoke test
Browse files Browse the repository at this point in the history
  • Loading branch information
ihexxa committed Nov 28, 2024
1 parent fe79d1c commit 988bceb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
3 changes: 3 additions & 0 deletions packages/insomnia-smoke-test/fixtures/runner-collection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,9 @@ resources:
console.log("it won't print");
afterResponseScript: |-
console.log("it won't print");
insomnia.test('happy tests', () => {
insomnia.expect(200).to.eql(200);
});
metaSortKey: 164
isPrivate: false
settingStoreCookies: true
Expand Down
28 changes: 19 additions & 9 deletions packages/insomnia-smoke-test/tests/smoke/runner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,16 +234,26 @@ test.describe('runner features tests', async () => {

await page.locator('.runner-request-list-printLogs').click();

// configure
await page.getByRole('tab', { name: 'advanced' }).click();
await page.locator('input[name="enable-log"]').click();
const expectToHaveLogs = [false, true];

// send
await page.getByRole('button', { name: 'Run', exact: true }).click();
for (const expectToHaveLog of expectToHaveLogs) {
// configure
await page.getByRole('tab', { name: 'advanced' }).click();
await page.locator('input[name="enable-log"]').click();

// send
await page.getByRole('button', { name: 'Run', exact: true }).click();

// verify there's no log
const responsePane = page.getByTestId('response-pane');
await page.getByRole('tab', { name: 'Console' }).click();
await expect(responsePane).not.toContainText("it won't print");
// verify there's no log
await page.getByText('1 / 1').first().click();
await page.getByRole('tab', { name: 'Console' }).click();

const consoleTabContent = page.locator('.pane-two');
if (expectToHaveLog) {
expect(consoleTabContent).toContainText("it won't print");
} else {
expect(consoleTabContent).not.toContainText("it won't print");
}
}
});
});

0 comments on commit 988bceb

Please sign in to comment.