* clean plate * npm i * log in e2e * global setup login * set license key * Revert "set license key" This reverts commit86d5db2c48. * create datatable test * fix wrong pg_creds * data table + db manager e2e test * DbManagerPage class * small refactor * create resource test + improvements * text db manager in resources * Factor test logic in classes * refactoring * refacto * alter table test * alter table e2e test * set schema in test * nits * fix wrong schema var * Correct setup and parallelization * reducedMotion * tests passing headless ! * bigger timeout * start e2e docker compose * e2e runs on all databases * nit test uid fix * refactp * stash * Better Workspace Storage settings * minio setup * nit * nit * super nit * Permission settings in modal * badge indicator * Fetch alter table metadata much faster * Upgrade duckdb to 1.4.3 * Ducklake tests * Disable transactional DDL for Ducklake (bug on their side) * git ignore env * bigquery tests passes * getJsonEnv * load coldef in parallel * Make Bigquery schema fetching much faster * makeLoadTableMetaDataQuery for entire db in bigquery * refactor getDbSchemas to avoid assignment side effect * fix col def * Better loading state mgmt * snowflake * fix snowflake primary keys * Test CI * fix setTimeout type * remove type node * test e2e ci * Revert "test e2e ci" This reverts commitbf98a755dc. * remove ci * fix snowflake pk query in alternate schemas * nit wait for coldefs * nit snowflake * Snowflake fk fix * UNPROCESSABLE_ENTITY instead of INTERNAL_ERROR * nits * fix alter pk in snowflake * yet other fixes * snowflake tests pass * nits
47 lines
1.5 KiB
TypeScript
47 lines
1.5 KiB
TypeScript
import { expect, Locator, Page } from '@playwright/test'
|
|
|
|
export class Toast {
|
|
static async expectSuccess(page: Page, message: string) {
|
|
const toast = page.locator(`.toast-success:has-text("${message}")`)
|
|
await expect(toast).toBeVisible({ timeout: 10000 })
|
|
}
|
|
|
|
static async expectError(page: Page, message: string) {
|
|
const toast = page.locator(`.toast-error:has-text("${message}")`)
|
|
await expect(toast).toBeVisible({ timeout: 10000 })
|
|
}
|
|
}
|
|
|
|
export class ConfirmationModal {
|
|
static async confirm(page: Page, modalSelector: string, buttonText: string) {
|
|
const confirmBtn = page.locator(`${modalSelector} button:has-text("${buttonText}")`)
|
|
await confirmBtn.click()
|
|
await page.locator(modalSelector).waitFor({ state: 'hidden' })
|
|
}
|
|
|
|
static async expectText(page: Page, modalSelector: string, text: string) {
|
|
const modal = page.locator(modalSelector)
|
|
await expect(modal).toHaveText(text)
|
|
}
|
|
}
|
|
|
|
export const prettify = (s: string) => (s.charAt(0).toUpperCase() + s.slice(1)).replace(/_/g, ' ')
|
|
|
|
export class Dropdown {
|
|
static getOption(page: Page, optionText: string, { exact = true } = {}) {
|
|
if (exact) return page.locator(`.select-dropdown-open li:has(:text-is("${optionText}"))`)
|
|
else return page.locator(`.select-dropdown-open li:has-text("${optionText}")`)
|
|
}
|
|
static async selectOption(
|
|
page: Page,
|
|
selectInput: Locator,
|
|
optionText: string,
|
|
{ exact = true } = {}
|
|
) {
|
|
await selectInput.click()
|
|
await selectInput.fill(optionText)
|
|
const option = this.getOption(page, optionText, { exact })
|
|
await option.click()
|
|
}
|
|
}
|