-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix: update action bar value after users click import from url #8643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fa4f05e
fix: update action bar value after users click import from url
ZxBing0066 61b0194
chore: update the comment and some name
ZxBing0066 38953e1
Merge branch 'develop' into fix/action-bar-not-refreshed
ZxBing0066 3a8ff24
Merge branch 'develop' into fix/action-bar-not-refreshed
ZxBing0066 4004da3
Merge branch 'develop' into fix/action-bar-not-refreshed
ZxBing0066 b66a081
Merge branch 'develop' into fix/action-bar-not-refreshed
ZxBing0066 dde4d92
Merge branch 'develop' into fix/action-bar-not-refreshed
ZxBing0066 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
81 changes: 81 additions & 0 deletions
81
packages/insomnia-smoke-test/fixtures/import-from-url.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
type: collection.insomnia.rest/5.0 | ||
name: simple | ||
meta: | ||
id: wrk_dc393cdd96524c44a632fdc3b09aa5c5 | ||
created: 1736279931529 | ||
modified: 1736279931529 | ||
collection: | ||
- url: http://localhost:4010/echo?foo=bar&baz=qux | ||
name: example http | ||
meta: | ||
id: req_49f06ac9024446728a9765162d56b95a | ||
created: 1666867365377 | ||
modified: 1666867670885 | ||
isPrivate: false | ||
method: GET | ||
scripts: | ||
preRequest: console.log('executing pre-request script'); | ||
settings: | ||
renderRequestBody: true | ||
encodeUrl: true | ||
followRedirects: global | ||
cookies: | ||
send: true | ||
store: true | ||
rebuildPath: true | ||
- url: ws://localhost:4010?foo=bar&baz=qux | ||
name: example websocket | ||
meta: | ||
id: ws-req_9030f28cd1a64b44971cee35bbc09987 | ||
created: 1666867628351 | ||
modified: 1666867647526 | ||
settings: | ||
encodeUrl: true | ||
followRedirects: global | ||
cookies: | ||
send: true | ||
store: true | ||
cookieJar: | ||
name: Default Jar | ||
meta: | ||
id: jar_5ac9997401a64a9ea81374670872319a | ||
created: 1666867357074 | ||
modified: 1666868115288 | ||
cookies: | ||
- id: bc6e6a71-1290-4334-8662-a49c1c58b037 | ||
key: foo | ||
value: bar | ||
domain: localhost | ||
expires: 2038-01-19T03:14:07.000Z | ||
path: / | ||
secure: false | ||
httpOnly: false | ||
environments: | ||
name: Base Environment | ||
meta: | ||
id: env_e86a031c9817439bb89991d31a46e50c | ||
created: 1666867357072 | ||
modified: 1666867924188 | ||
isPrivate: false | ||
data: | ||
foo: bar | ||
current-env: base | ||
subEnvironments: | ||
- name: production | ||
meta: | ||
id: env_f5742e2375e24f25b65c2ae97fbbda30 | ||
created: 1666867721814 | ||
modified: 1666867928920 | ||
isPrivate: false | ||
data: | ||
foo: bar | ||
current-env: production | ||
- name: staging | ||
meta: | ||
id: env_fdc1a90ec92c42899f599a4e8ab40a5f | ||
created: 1666867735110 | ||
modified: 1666867933395 | ||
isPrivate: false | ||
data: | ||
foo: bar | ||
current-env: staging |
68 changes: 68 additions & 0 deletions
68
packages/insomnia-smoke-test/tests/smoke/import-from-url.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { expect } from '@playwright/test'; | ||
|
||
import { loadFixture } from '../../playwright/paths'; | ||
import { test } from '../../playwright/test'; | ||
|
||
test.describe('Import from URL', () => { | ||
test.beforeEach(async ({ app, page }) => { | ||
const text = await loadFixture('import-from-url.yaml'); | ||
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text); | ||
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(); | ||
await page.getByLabel('simple').click(); | ||
}); | ||
|
||
test('Should work as expected in HTTP request', async ({ page }) => { | ||
const requestUrl = 'http://localhost:4010/echo?foo=bar&baz=qux'; | ||
const codeMirror = page.getByTestId('OneLineEditor').first().locator('.CodeMirror'); | ||
|
||
await page.getByText('example http').click(); | ||
|
||
const importFromUrlButton = page.getByRole('button', { name: 'Import from URL' }); | ||
await importFromUrlButton.click(); | ||
|
||
await expect | ||
.soft(codeMirror.locator('.CodeMirror-line').getByRole('presentation')) | ||
.toHaveText('http://localhost:4010/echo'); | ||
|
||
// send | ||
await page.getByTestId('request-pane').getByRole('button', { name: 'Send' }).click(); | ||
|
||
// verify response | ||
const statusTag = page.locator('[data-testid="response-status-tag"]:visible'); | ||
await expect.soft(statusTag).toContainText('200 OK'); | ||
|
||
const responsePane = page.getByTestId('response-pane'); | ||
await page.getByRole('tab', { name: 'Console' }).click(); | ||
|
||
await expect.soft(responsePane).toContainText(requestUrl); | ||
}); | ||
|
||
test('Should work as expected in Websocket request', async ({ page }) => { | ||
const requestUrl = 'ws://localhost:4010?foo=bar&baz=qux'; | ||
const codeMirror = page.getByTestId('OneLineEditor').first().locator('.CodeMirror'); | ||
|
||
await page.getByText('example websocket').click(); | ||
|
||
const importFromUrlButton = page.getByRole('button', { name: 'Import from URL' }); | ||
await importFromUrlButton.click(); | ||
|
||
await expect | ||
.soft(codeMirror.locator('.CodeMirror-line').getByRole('presentation')) | ||
.toHaveText('ws://localhost:4010'); | ||
|
||
// connect | ||
await page.getByTestId('request-pane').getByRole('button', { name: 'Connect' }).click(); | ||
|
||
// verify response | ||
const statusTag = page.locator('[data-testid="response-status-tag"]:visible'); | ||
await expect.soft(statusTag).toContainText('101 Switching Protocols'); | ||
|
||
const responsePane = page.getByTestId('response-pane'); | ||
await page.getByRole('tab', { name: 'Console' }).click(); | ||
|
||
await expect.soft(responsePane).toContainText(requestUrl); | ||
}); | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.