Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
73 lines
2.1 KiB
TypeScript
73 lines
2.1 KiB
TypeScript
import type { Locator } from '@playwright/test';
|
|
|
|
import { BasePage } from './BasePage';
|
|
import { CredentialModal } from './components/CredentialModal';
|
|
|
|
export class TemplateCredentialSetupPage extends BasePage {
|
|
readonly credentialModal = new CredentialModal(this.page.getByTestId('editCredential-modal'));
|
|
|
|
getTitle(titleText: string): Locator {
|
|
return this.page.getByRole('heading', { name: titleText, level: 1 });
|
|
}
|
|
|
|
getInfoCallout(): Locator {
|
|
return this.page.getByTestId('info-callout');
|
|
}
|
|
|
|
getFormSteps(): Locator {
|
|
return this.page.getByTestId('setup-credentials-form-step');
|
|
}
|
|
|
|
getStepHeading(step: Locator): Locator {
|
|
return step.getByTestId('credential-step-heading');
|
|
}
|
|
|
|
getStepDescription(step: Locator): Locator {
|
|
return step.getByTestId('credential-step-description');
|
|
}
|
|
|
|
getSkipLink(): Locator {
|
|
return this.page.getByRole('link', { name: 'Skip' });
|
|
}
|
|
|
|
getContinueButton(): Locator {
|
|
return this.page.getByTestId('continue-button');
|
|
}
|
|
|
|
getCanvasSetupButton(): Locator {
|
|
return this.page.getByTestId('setup-credentials-button');
|
|
}
|
|
|
|
getCanvasCredentialModal(): Locator {
|
|
return this.page.getByTestId('setup-workflow-credentials-modal');
|
|
}
|
|
|
|
getSetupCredentialModalSteps(): Locator {
|
|
return this.page
|
|
.getByTestId('setup-workflow-credentials-modal')
|
|
.getByTestId('setup-credentials-form-step');
|
|
}
|
|
|
|
getCreateCredentialButton(appName: string): Locator {
|
|
return this.page.getByRole('button', { name: `Create new ${appName} credential` });
|
|
}
|
|
|
|
getMessageBox(): Locator {
|
|
// Using class selector as Element UI message box doesn't have semantic attributes
|
|
return this.page.locator('.el-message-box');
|
|
}
|
|
|
|
/** Opens credential creation modal and waits for it to be visible */
|
|
async openCredentialCreation(appName: string): Promise<void> {
|
|
await this.getCreateCredentialButton(appName).click();
|
|
await this.credentialModal.waitForModal();
|
|
}
|
|
|
|
/** Waits for the message box to appear and clicks the cancel button to dismiss it */
|
|
async dismissMessageBox(): Promise<void> {
|
|
const messageBox = this.getMessageBox();
|
|
await messageBox.waitFor({ state: 'visible' });
|
|
await messageBox.locator('.btn--cancel').click();
|
|
}
|
|
}
|