Files
upstream-mirror 135ffdb085
Some checks failed
Admin | Playwright Tests / Admin | Playwright Tests | Shard 1 Of 6 (push) Failing after 37s
Admin | Playwright Tests / Admin | Playwright Tests | Shard 2 Of 6 (push) Failing after 7s
Admin | Playwright Tests / Admin | Playwright Tests | Shard 4 Of 6 (push) Failing after 7s
Admin | Playwright Tests / Admin | Playwright Tests | Shard 6 Of 6 (push) Failing after 6s
Linting Tests / PHP 8.3 test on ubuntu-latest (push) Failing after 5s
CI / PHP 8.3 test on ubuntu-latest (push) Failing after 6s
Skills Consistency / validate-skills (push) Successful in 10s
Admin | Playwright Tests / Admin | Playwright Tests | Shard 3 Of 6 (push) Failing after 7s
Admin | Playwright Tests / Admin | Playwright Tests | Shard 5 Of 6 (push) Failing after 6s
snapshot of https://github.com/krayin/laravel-crm.git (2.2, 2026-09-18; blobs > 131072B omitted)
2026-09-18 04:37:41 +05:00

40 lines
1.3 KiB
TypeScript

import { expect, Locator, Page } from "playwright/test";
import { SettingsPage } from "../SettingsPage";
export class SourcesPage extends SettingsPage {
readonly page: Page;
readonly createSourceLink:Locator;
readonly saveSourceButton:Locator;
readonly thisName:Locator;
constructor(page: Page) {
super(page);
this.page = page;
this.createSourceLink=page.getByRole('button', { name: 'Create Source' });
this.saveSourceButton=page.getByRole('button', { name: 'Save Source' })
this.thisName=page.getByRole('textbox', { name: 'Name' });
}
async searchSource(thisName:string)
{
await this.searchInputExact.fill(thisName)
await this.page.keyboard.press('Enter');
}
async sourceForm(sourceName:string)
{
await this.thisName.fill(sourceName);
await this.saveSourceButton.click();
await expect(this.successMessage.first()).toBeVisible();
await this.searchSource(sourceName);
await expect(this.page.getByRole('paragraph').filter({ hasText: sourceName }).first()).toBeVisible();
}
async deleteSource()
{
await this.firstDeleteIcon.click()
await this.agreeButton.click();
await expect(this.successMessage.first()).toBeVisible();
}
}