mirror of
https://github.com/Kong/insomnia.git
synced 2026-11-05 20:43:52 -05:00
feat(insomnia-test): enhance credential menus and improve spec handling
This commit is contained in:
3 files changed
+9
-29
No files matched your search
@@ -61,28 +61,6 @@ export class PreferencesCredentialsComponent extends PreferencesTabComponent {
|
||||
await modal.waitForHidden();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a custom (username/PAT) Git credential from the Credentials tab,
|
||||
* which must already be open (see `openCredentialsTab()`).
|
||||
*/
|
||||
async addCustomCredential(credential: GitCredential): Promise<void> {
|
||||
const modal = this.page.getByRole("dialog", {
|
||||
name: /Access Token Credential/,
|
||||
});
|
||||
await this.dialog
|
||||
.getByRole("button", { name: "Create Git Credential" })
|
||||
.click();
|
||||
await this.page
|
||||
.getByRole("menuitem", { name: "Access Token", exact: true })
|
||||
.click();
|
||||
await this.page.getByLabel("Author Email").fill(credential.authorEmail);
|
||||
await this.page.getByLabel("Author Name").fill(credential.authorName);
|
||||
await this.page.getByLabel("Username").fill(credential.username);
|
||||
await this.page.getByLabel("Git Access Token").fill(credential.password);
|
||||
await this.page.getByRole("button", { name: "Save Credential" }).click();
|
||||
await expect(modal).toBeHidden({ timeout: DEFAULT_TIMEOUT });
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an AWS cloud (vault) credential from the Credentials tab's
|
||||
* "Service Provider Credential List", which must already be open (see
|
||||
|
||||
@@ -382,10 +382,14 @@ export class SpecPage extends BasePage {
|
||||
* Reads every suite name currently listed in the Test Suites sidebar.
|
||||
*/
|
||||
async getTestSuiteNames(): Promise<string[]> {
|
||||
return new TableComponent(
|
||||
this.page,
|
||||
this.page.locator(this.TEST_SUITES_LIST),
|
||||
).rows.allInnerTexts();
|
||||
// Re-opening the Tests tab re-renders the list; wait for it to settle
|
||||
// so a read taken mid-render doesn't return a stale or partial list.
|
||||
return this.waitForStableValue(() =>
|
||||
new TableComponent(
|
||||
this.page,
|
||||
this.page.locator(this.TEST_SUITES_LIST),
|
||||
).rows.allInnerTexts(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,7 +23,5 @@ test("Verify Renaming And Deleting A Project Via The Dashboard", async ({
|
||||
|
||||
expect(foundByNewName?.id).toBe(project.id);
|
||||
expect(foundByOldName).toBeUndefined();
|
||||
await expect
|
||||
.poll(() => workspaceFlow.getProject(newName), { timeout: 10_000 })
|
||||
.toBeUndefined();
|
||||
expect(await workspaceFlow.getProject(newName)).toBeUndefined();
|
||||
});
|
||||
Reference in new issue
Block a user