insomnia/packages/insomnia-smoke-test/tests/prerelease/design-interactions.test.ts
Insomnia 51b9ef76e9
🚀 8.6.1 (#7014)
* Bump app version to 8.6.1

* feat(unit-tests): Unit test reordering (#7020)

* re-orderable test suites

* re-orderable tests

* fix ts

* Use db methods for sorting

* sort suites and unit tests in inso

* fix suite rename

* Fixes https://github.com/Kong/insomnia/issues/7011 (#7012)

* Fixes https://github.com/Kong/insomnia/issues/7009 (#7010)

* chore: edit changelog process [INS-3456] (#7001)

* fix(workspace): Add default name for when creating a workspace (#7046)

* Add default name for when creating a design/collection

* workspace update and creation

* fix filter history keys not being valid selectors (#7040)

* remove invalid wide css prop (#7041)

* feat(environment): update environments icons (#7050)

* update environments icons

* fix workspace name

* fix one line editor being scrollable (#7059)

* change 8.0 to 8 (#7061)

* Cleanup page containers and add hint container in the page (#7060)

* feat(pane-tabs): Consistent styles for tabs (#7062)

* response/request pane tab counts

* tab dropdown colors

* fix updates to db leading to errors in loader fetchers (#7033)

* feat(command-palette): add button to open the command palette (#7064)

* add button for quick search

* update button styles in project

* make it look good with gh stars

* fix ts issue

* changelog

---------

Co-authored-by: Jack Kavanagh <3679927+jackkav@users.noreply.github.com>
Co-authored-by: James Gatz <jamesgatzos@gmail.com>
Co-authored-by: Jeroen Van den Berghe <vandenberghe.jeroen@gmail.com>
Co-authored-by: Filipe Freire <livrofubia@gmail.com>
2024-02-06 12:16:54 +00:00

51 lines
2.3 KiB
TypeScript

import { expect } from '@playwright/test';
import { loadFixture } from '../../playwright/paths';
import { test } from '../../playwright/test';
test.describe('Design interactions', async () => {
test.slow(process.platform === 'darwin' || process.platform === 'win32', 'Slow app start on these platforms');
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.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
await page.getByText('unit-test.yaml').click();
// Switch to Test tab
await page.click('a:has-text("Test")');
// Run tests and check results
await page.getByLabel('Run all tests').click();
await expect(page.locator('.app')).toContainText('Request A is found');
await expect(page.locator('.app')).toContainText('Request B is not found');
await expect(page.locator('.app')).toContainText('Tests passed');
// Create a new test suite
await page.click('text=New test suite');
// Rename test suite
await page.getByLabel('Request Collection').getByText('New Suite');
await page.getByRole('button', { name: 'New Suite' }).dblclick();
await page.getByRole('textbox').fill('New Suite 2');
await page.getByRole('textbox').press('Enter');
// Add a new test
await page.getByLabel('New test').click();
// Rename test
await page.getByRole('button', { name: 'Returns 200', exact: true }).dblclick();
// TODO(filipe) - Something is wrong here. It should be a single dblclick
await page.getByRole('button', { name: 'Returns 200', exact: true }).dblclick();
await page.getByRole('textbox').fill('Returns 200 and works');
await page.getByRole('textbox').press('Enter');
await page.getByRole('heading', { name: 'Returns 200 and works' }).click();
// Use autocomplete inside the test code
// TODO(filipe) - add this in another PR
});
});