insomnia/packages/insomnia-smoke-test
Pavlos Koutoglou e38ece1ab7
Feature/ins-2070-bug-updowntabshifttab-not-working (#5615)
* Update version of react-aria package

* Create dropdown hint component

* Create dropdown button component

* Create the popover component

* Create the menu item component

* Create the menu section component

* Create the menu component

* Create the dropdown related components

* Change the hotkey html tag

* Added full width option for prompt-button

* Replace the dropdown with the new

* Add some default props for dropdown

* Used themed button into dropdown button

* Added style prop for dropdown

* Remove checkmark from menu item

* Added styled props to popover

* Remove inner button from account toolbar

* Added new dropdown into cookie-list

* Revert package update

* WIP

* Delete button component and replace it's usage with dropdown button

* Fix spacing

* Added className for code-editor dropdown

* Remove the old dropdown

* Change import

* Revert some ref changes

* Added ref to dropdown

* Fixed some styles

* Fix issues like autosave and added isDisable prop

* Add title

* Remove insomnia-common imports

* Remove insomnia-common imports

* Fix code format

* Change style and fix code format

* Fix styles

* Replace dropdown import

* Fix divider style

* Fix last icon in sidebar create dropdown

* Fix issue with dropdown and the resizing screen

* Fix linter issues

* Moved the prompt button into itemContent component

* Change styled component

* Fix issue with sidebar-request-row to display the dropdown on hover

* Remove the item content in a separate component

* Remove unused css

* Destructure children props

* Fix trigger prop for grpc-method-dropdown

* Added prompt button when user delete test suite

* Hide empty dropdown items from section

* Fix linter issues

* Added Checkmark into item content

* Fix issue with linter and shortcut component

* Fixed linter issues

* Revert fragments

* Fix linter issues

* Added props for multiple select and disable

* Fix close issue with sidebar dropdown

* Update disable and stay open prop for all dropdowns

* Added aria-label for dropdown, section, items

* Added selected style for item

* Added logic for disabled items

* Fixed issue with selected items

* Fix issue with selection of grpc method dropdown

* Added aria-label to code-editor

* Fix issue with onClick and prompt

* Hide sections if it's empty

* Remove on select from item content

* Pass closeOnSelect props in the menu

* Removed dataTestId from dropdown items in request-actions

* Fix debug sidebar dropdown tests

* Change the cookie editor interactions tests

* Fix dashboard interactions tests

* Fix design-interactions tests

* Fixed grpc-interactions tests

* Fix plugins interactions tests

* Fix preferences interactions tests

* Fixed request-pane-tab tests

* Fixed app smoke tests

* Update git-sync smoke tests

* Fix space issue

* Fixed graphql smoke test

* Fixed oauth smoke test

* Fixed oauth smoke test

* Fixed websocket smoke test

* Fixed cookie-editor-interactions tests

* Remove the dropdown unit test

* Made small refactoring and remove unnecessary props

* Fix issue with grpc-method-dropdown

* Change the grpc smoke test

* Added default role props

* Update all tests that use project role

* Remove console.log

* Fix issue with themes

* REmove dropdown import from index.less file

* Remove handleClick and add some comments

* Use getItemCount from react-stately

* Remove method-dropdown css

* Fix shortcut button style

* remove extra space on sync-dropdown

* fix lint

* Remove unused prop

* Fix issue with remote workspace dropdown

* remove divider on first section if empty

* remove unused showGrpc option in method dropdown

* Fix issue with workspace-dropdown

* Fix git-sync-dropdown issues

* Fix issue with remove workspaces dropdown

* Fix sync-dropdown component

* Added disable style

* Moved server reflection and proto file outside of the dropdown

* Fix style when item is selected

* Fix issue with grpc smoke test

* Fix issue with menu props

* Disable server reflection button if url is empty

Co-authored-by: Filipe Freire <livrofubia@gmail.com>
Co-authored-by: gatzjames <jamesgatzos@gmail.com>
2023-01-20 16:49:52 +02:00
..
cli Support custom spectral ruleset in inso (#5488) 2022-12-14 12:47:28 +01:00
docs/imgs [INS-2051] Reorganize smoke tests README (#5264) 2022-10-19 08:58:49 +01:00
fixtures gRPC server reflection support (#5518) 2022-12-14 12:27:39 +00:00
playwright skip analytics in ci (#5385) 2022-11-04 17:32:12 +00:00
server Add server reflection to smoke test grpc server (#5517) 2022-12-13 21:34:15 +01:00
tests Feature/ins-2070-bug-updowntabshifttab-not-working (#5615) 2023-01-20 16:49:52 +02:00
.eslintignore Enable ESLint & TS for smoke tests (#3397) 2021-05-19 07:49:48 -04:00
.eslintrc.js adds eslint-config-helpers (#3912) 2021-08-12 18:01:54 -04:00
.gitignore removes insomnia designer migration code (#4404) 2022-01-25 11:14:24 -05:00
.npmrc Chore: replace spectron with playwright (#4305) 2021-12-17 13:05:14 +01:00
CLI.md [INS-2051] Reorganize smoke tests README (#5264) 2022-10-19 08:58:49 +01:00
jest.config.js chore(deps) updates (all but insomnia) to use @jest/globals (#4793) 2022-05-18 17:27:31 -04:00
package-lock.json Bump app version to 2022.7.5 and lerna package versions 2023-01-19 15:49:31 +00:00
package.json v3.12.0 2023-01-19 15:49:16 +00:00
playwright.config.ts bump playwright to 1.30 canary (#5684) 2023-01-18 13:14:01 +02:00
README.md Add prerelease test for #5664 / INS-2267 (#5668) 2023-01-13 17:17:01 +01:00
tsconfig.build.json tsconfig cleanup (#4908) 2022-06-27 12:57:50 -04:00
tsconfig.json tsconfig cleanup (#4908) 2022-06-27 12:57:50 -04:00

Insomnia Smoke Tests

Playwright

This project contains the smoke testing suite for Insomnia App.

To find more about Inso CLI smoke tests, check this document.

Quick-start

Prerequisites:

  • Clone the project
  • Run npm run bootstrap

To run all tests:

  • In one terminal run: npm run watch:app
  • In another terminal run: npm run test:smoke:dev

To run single tests:

  • Filter by the file or test title, e.g. npm run test:smoke:dev -- oauth

Debugging and Developing Tests locally

Playwright VS Code extension

In order to run/debug tests directly from VS Code:

  • Install the Playwright extension.
  • With the extension installed, run on terminal npm run watch:app.

You can trigger tests from the Testing tab, or within the test files clicking the run button.

editor

If no tests appear, you may need to run "Refresh playwright tests". This can be done from the command palette, or by using the button at the top of the Testing tab.

refresh

Playwright Inspector

You can step through tests with playwright inspector: PWDEBUG=1 npm run test:smoke:dev

This is also useful to help create new tests.

playwright inspector

Playwright Trace viewer

We generate Playwright Traces when tests run. These can be used to debug local and CI test failures.

playwright trace viewer

To open a local trace viewer for a given test output, run:

# Example:
npx playwright show-trace packages/insomnia-smoke-test/screenshots/app-can-send-requests/trace.zip

Alternatively you can upload this trace to trace.playwright.dev.

Additional Log levels

You can enable additional logging to help you debug tests:

  • Playwright logs: DEBUG=pw:api npm run test:smoke:dev
  • Insomnia console logs: DEBUG=pw:browser npm run test:smoke:dev
  • WebServer console logs: DEBUG=pw:WebServer npm run test:smoke:dev

Reproducing CI Failures

Getting traces from CI

Traces from CI execution can be found in the failed CI job's artifacts.

artifacts

After downloading the artifacts, these can be extracted and loaded up into the Trace viewer.

Build and package methods

It's possible to run the smoke tests for:

  • A build, the JS bundle that is loaded into an electron client
  • A package, the executable binary (e.g. .dmg or .exe)

For build:

# Transpile js bundle
npm run app-build

# Run tests
npm run test:smoke:build

For package:

# Build executable in /packages/insomnia/dist
npm run app-package

# Run tests
npm run test:smoke:package

Each of the above commands will automatically run the Express server, so you do not need to take any extra steps.

Non recurring tests

Non recurring / non-CI tests, like pre-release ones, can be run using Playwright VS Code extension or by running test:dev against the desired test file:

npm run test:dev --prefix packages/insomnia-smoke-test -- preferences-interactions