Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 3 additions & 4 deletions packages/insomnia-smoke-test/tests/critical/bundling.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ test('can use node-libcurl, httpsnippet, hidden browser window', async ({ app, p
const responseBody = page.locator('[data-testid="CodeEditor"]:visible', {
has: page.locator('.CodeMirror-activeline'),
});
await page.getByRole('button', { name: 'Create in project' }).click();

const text = await loadFixture('smoke-test-collection.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);

await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down Expand Up @@ -42,8 +42,7 @@ test('can use external modules in scripts ', async ({ app, page }) => {

// import collection
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);
await page.getByRole('button', { name: 'Create in project' }).click();
await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ test('can send request with custom ca root certificate', async ({ app, page }) =
const text = await loadFixture('smoke-test-collection.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);

await page.getByRole('button', { name: 'Create in project' }).click();
await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ test.describe('after-response script features tests', async () => {
const text = await loadFixture('after-response-collection.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);

await page.getByRole('button', { name: 'Create in project' }).click();
await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down
7 changes: 2 additions & 5 deletions packages/insomnia-smoke-test/tests/smoke/app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ test('can send requests', async ({ app, page }) => {
const text = await loadFixture('smoke-test-collection.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);

await page.getByRole('button', { name: 'Create in project' }).click();
await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down Expand Up @@ -84,12 +83,10 @@ test('can send requests', async ({ app, page }) => {
// This feature is unsafe to place beside other tests, cancelling a request can cause network code to block
// related to https://linear.app/insomnia/issue/INS-973
test('can cancel requests', async ({ app, page }) => {
await page.getByRole('button', { name: 'Create in project' }).click();

const text = await loadFixture('smoke-test-collection.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);

await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ test('Command palette - can switch between requests and workspaces', async ({ ap
const text = await loadFixture('smoke-test-collection.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);

await page.getByRole('button', { name: 'Create in project' }).click();
await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand All @@ -20,8 +19,7 @@ test('Command palette - can switch between requests and workspaces', async ({ ap
const swaggerDoc = await loadFixture('swagger2.yaml');
await app.evaluate(async ({ clipboard }, swaggerDoc) => clipboard.writeText(swaggerDoc), swaggerDoc);

await page.getByRole('button', { name: 'Create in project' }).click();
await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import { test } from '../../playwright/test';
test.describe('Cookie editor', async () => {

test.beforeEach(async ({ app, page }) => {
await page.getByRole('button', { name: 'Create in project' }).click();
const text = await loadFixture('simple.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);
await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ test.describe('Dashboard', async () => {
await expect(page.locator('.app')).toContainText('This is an empty project, to get started create your first resource:');

// Rename Project
await page.getByRole('row', { name: 'My Project' }).focus();
await page.getByRole('row', { name: 'My Project' }).getByRole('button', { name: 'Project Actions' }).click();
await page.getByRole('menuitemradio', { name: 'Settings' }).click();
await page.getByPlaceholder('My Project').click();
Expand All @@ -33,6 +34,7 @@ test.describe('Dashboard', async () => {
await expect(page.locator('.app')).toContainText('My Project123');

// Delete project
await page.getByRole('row', { name: 'My Project' }).focus();
await page.getByRole('row', { name: 'My Project' }).getByRole('button', { name: 'Project Actions' }).click();
await page.getByRole('menuitemradio', { name: 'Delete' }).click();
await page.getByRole('button', { name: 'Delete' }).click();
Expand All @@ -52,10 +54,9 @@ test.describe('Dashboard', async () => {
await expect(page.locator('.app')).not.toContainText('Git Sync');
await expect(page.locator('.app')).not.toContainText('Setup Git Sync');

await page.getByRole('button', { name: 'Create in project' }).click();
const text = await loadFixture('multiple-workspaces.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);
await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ import { test } from '../../playwright/test';
test.describe('Debug-Sidebar', async () => {
test.slow(process.platform === 'darwin' || process.platform === 'win32', 'Slow app start on these platforms');
test.beforeEach(async ({ app, page }) => {
await page.getByRole('button', { name: 'Create in project' }).click();
const text = await loadFixture('simple.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);
await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ test.describe('Design interactions', async () => {

test('Unit Test interactions', async ({ app, page }) => {
// Setup
await page.getByRole('button', { name: 'Create in project' }).click();
const text = await loadFixture('unit-test.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);
await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import { test } from '../../playwright/test';
test.describe('Environment Editor', async () => {

test.beforeEach(async ({ app, page }) => {
await page.getByRole('button', { name: 'Create in project' }).click();
const text = await loadFixture('environments.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);
await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down
16 changes: 4 additions & 12 deletions packages/insomnia-smoke-test/tests/smoke/graphql.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ import { test } from '../../playwright/test';
test('can render schema and send GraphQL requests', async ({ app, page }) => {
test.slow(process.platform === 'darwin' || process.platform === 'win32', 'Slow app start on these platforms');

await page.getByRole('button', { name: 'Create in project' }).click();

// Copy the collection with the graphql query to clipboard
const text = await loadFixture('graphql.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);

// Import from clipboard
await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down Expand Up @@ -57,14 +55,12 @@ test('can render schema and send GraphQL requests', async ({ app, page }) => {
test('can render schema and send GraphQL requests with object variables', async ({ app, page }) => {
test.slow(process.platform === 'darwin' || process.platform === 'win32', 'Slow app start on these platforms');

await page.getByRole('button', { name: 'Create in project' }).click();

// Copy the collection with the graphql query to clipboard
const text = await loadFixture('graphql.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);

// Import from clipboard
await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down Expand Up @@ -99,14 +95,12 @@ test('can render schema and send GraphQL requests with object variables', async
test('can render numeric environment', async ({ app, page }) => {
test.slow(process.platform === 'darwin' || process.platform === 'win32', 'Slow app start on these platforms');

await page.getByRole('button', { name: 'Create in project' }).click();

// Copy the collection with the graphql query to clipboard
const text = await loadFixture('graphql.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);

// Import from clipboard
await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down Expand Up @@ -141,11 +135,9 @@ test('can render numeric environment', async ({ app, page }) => {
test('can send GraphQL requests after editing and prettifying query', async ({ app, page }) => {
test.slow(process.platform === 'darwin' || process.platform === 'win32', 'Slow app start on these platforms');

await page.getByRole('button', { name: 'Create in project' }).click();

const text = await loadFixture('graphql.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);
await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ test.describe('gRPC interactions', () => {
let streamMessage: Locator;

test.beforeEach(async ({ app, page }) => {
await page.getByRole('button', { name: 'Create in project' }).click();

const text = await loadFixture('grpc.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);

await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down
4 changes: 1 addition & 3 deletions packages/insomnia-smoke-test/tests/smoke/grpc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ test('can send gRPC requests with reflection', async ({ app, page }) => {
has: page.locator('.CodeMirror-activeline'),
});

await page.getByRole('button', { name: 'Create in project' }).click();

const text = await loadFixture('grpc.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);

await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down
3 changes: 1 addition & 2 deletions packages/insomnia-smoke-test/tests/smoke/oauth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ test('can make oauth2 requests', async ({ app, page }) => {
});

const projectView = page.locator('#wrapper');
await projectView.getByRole('button', { name: 'Create in project' }).click();

const text = await loadFixture('oauth.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);

await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ test.describe('pre-request features tests', async () => {
const text = await loadFixture('pre-request-collection.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);

await page.getByRole('button', { name: 'Create in project' }).click();
await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down Expand Up @@ -450,8 +449,7 @@ test.describe('unhappy paths', async () => {
const text = await loadFixture('pre-request-collection.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);

await page.getByRole('button', { name: 'Create in project' }).click();
await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ test.describe('test hidden window handling', async () => {
const text = await loadFixture('pre-request-collection.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);

await page.getByRole('button', { name: 'Create in project' }).click();
await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand All @@ -37,8 +36,7 @@ test.describe('test hidden window handling', async () => {
const text = await loadFixture('pre-request-collection.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);

await page.getByRole('button', { name: 'Create in project' }).click();
await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down Expand Up @@ -79,8 +77,7 @@ test.describe('test hidden window handling', async () => {
const text = await loadFixture('pre-request-collection.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);

await page.getByRole('button', { name: 'Create in project' }).click();
await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ test('Preferences through keyboard shortcut', async ({ page }) => {

// Quick reproduction for Kong/insomnia#5664 and INS-2267
test('Check filter responses by environment preference', async ({ app, page }) => {
await page.getByRole('button', { name: 'Create in project' }).click();
const text = await loadFixture('simple.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);
await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.getByLabel('Import').click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
Expand Down
Loading