insomnia/packages/insomnia-smoke-test/tests/prerelease/preferences-interactions.test.ts
James Gatz 29acc92559
Improve import UX (#5869)
* add import routes and modal

* fix paths

* fix paths

* save

* remove import.ts

* ui

* save

* fix tests

* fix tests

* fix tests

* remove outdated test

* update import tests

* lint and ts fixes

* add section title and fix some style issues

* close modals on import success

* error handling for empty content

* fix api spec imports

* Simplify importResources function

Co-authored-by: Filipe Freire <filipe.r.freire@gmail.com>

* cleanup

* settings import button styles

* remove comment

* update tests

* comment for app-command imports

* fix test lint error

* update comments

* comment out app/import for now

---------

Co-authored-by: Filipe Freire <filipe.r.freire@gmail.com>
2023-03-31 10:53:22 +00:00

48 lines
2.0 KiB
TypeScript

import { loadFixture } from '../../playwright/paths';
import { test } from '../../playwright/test';
test('Preferences through click', async ({ page }) => {
await page.locator('[data-testid="settings-button"]').click();
await page.locator('text=Insomnia Preferences').first().click();
});
test('Preferences through keyboard shortcut', async ({ page }) => {
if (process.platform === 'darwin') {
await page.locator('.app').press('Meta+,');
} else {
await page.locator('.app').press('Control+,');
}
await page.locator('text=Insomnia Preferences').first().click();
});
// Quick reproduction for Kong/insomnia#5664 and INS-2267
test('Check filter responses by environment preference', async ({ app, page }) => {
await page.getByTestId('project').click();
await page.getByRole('button', { name: 'Create' }).click();
const text = await loadFixture('simple.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);
await page.getByRole('menuitem', { name: 'Import' }).click();
await page.getByText('Clipboard').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('button', { name: 'Import' }).click();
await page.getByRole('link', { name: 'Debug' }).click();
// Send a request
await page.getByRole('button', { name: 'example http' }).click();
await page.click('[data-testid="request-pane"] button:has-text("Send")');
await page.click('text=Timeline');
await page.locator('text=HTTP/1.1 200 OK').click();
// Set filter responses by environment
await page.locator('[data-testid="settings-button"]').click();
await page.locator('text=Insomnia Preferences').first().click();
await page.locator('text=Filter responses by environment').click();
await page.locator('.app').press('Escape');
// Re-send the request and check timeline
await page.locator('[data-testid="request-pane"] button:has-text("Send")').click();
await page.click('text=Timeline');
await page.locator('text=HTTP/1.1 200 OK').click();
});