2023-01-13 16:17:01 +00:00
|
|
|
import { loadFixture } from '../../playwright/paths';
|
2023-01-04 17:10:31 +00:00
|
|
|
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();
|
|
|
|
});
|
2023-01-13 16:17:01 +00:00
|
|
|
|
|
|
|
// Quick reproduction for Kong/insomnia#5664 and INS-2267
|
|
|
|
test('Check filter responses by environment preference', async ({ app, page }) => {
|
2023-08-28 13:53:37 +00:00
|
|
|
await page.getByRole('button', { name: 'Create in project' }).click();
|
2023-01-13 16:17:01 +00:00
|
|
|
const text = await loadFixture('simple.yaml');
|
|
|
|
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);
|
2023-08-28 13:53:37 +00:00
|
|
|
await page.getByRole('menuitemradio', { name: 'Import' }).click();
|
2023-03-31 10:53:22 +00:00
|
|
|
await page.getByText('Clipboard').click();
|
|
|
|
await page.getByRole('button', { name: 'Scan' }).click();
|
2023-06-27 18:46:43 +00:00
|
|
|
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
|
2023-06-27 15:43:51 +00:00
|
|
|
await page.getByText('Collectionsimplejust now').click();
|
2023-01-13 16:17:01 +00:00
|
|
|
|
|
|
|
// Send a request
|
2023-08-22 16:12:29 +00:00
|
|
|
await page.getByLabel('Request Collection').getByRole('row', { name: 'example http' }).click();
|
2023-01-13 16:17:01 +00:00
|
|
|
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();
|
|
|
|
});
|