Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
242 changes: 121 additions & 121 deletions tests/test-env/playwright-specific/getBy.spec.ts
Original file line number Diff line number Diff line change
@@ -1,121 +1,121 @@
import { test, expect } from '@playwright/test';
import { gotoTestEnv, TEST_ENV_URL } from '../../helpers/goto';
const TIMEOUT = 5000;
test.describe('Locator API - getBy - Tests', () => {
test.beforeEach(async ({ page }) => {
await gotoTestEnv(page, TEST_ENV_URL);
});
test('getByRole - img - alt', async ({ page }) => {
test.slow();
await expect(page.getByRole('img', { name: 'Healenium Logo' })).toBeVisible({ timeout: TIMEOUT });
// Click Change locators button to test healing
const submitBtn = page.locator('#Submit');
await submitBtn.click();
// Test healing - same action should work after locator change
await expect(page.getByRole('img', { name: 'Healenium Logo' })).toBeVisible({ timeout: TIMEOUT });
});
test('getByRole - textbox - aria label', async ({ page }) => {
test.slow();
await expect(page.getByRole('textbox', { name: 'change_tag_aria_label' })).toBeVisible({ timeout: TIMEOUT });
// Click Change locators button to test healing
const submitBtn = page.locator('#Submit');
await submitBtn.click();
// Test healing - same action should work after locator change
await expect(page.getByRole('textbox', { name: 'change_tag_aria_label' })).toBeVisible({ timeout: TIMEOUT });
});
test('getByRole - textbox - aria labelledby', async ({ page }) => {
test.slow();
await expect(page.getByRole('textbox', { name: 'Field labeled by' })).toBeVisible({ timeout: TIMEOUT });
// Click Change locators button to test healing
const submitBtn = page.locator('#Submit');
await submitBtn.click();
// Test healing - same action should work after locator change
await expect(page.getByRole('textbox', { name: 'Field labeled by' })).toBeVisible({ timeout: TIMEOUT });
});
test('getByText', async ({ page }) => {
test.slow();
await expect(page.getByText('Green Item')).toBeVisible({ timeout: TIMEOUT });
// Click Change locators button to test healing
const submitBtn = page.locator('#Submit');
await submitBtn.click();
// Test healing - same action should work after locator change
await expect(page.getByText('Green Item')).toBeVisible({ timeout: TIMEOUT });
});
test('getByLabel', async ({ page }) => {
test.slow();
await expect(page.getByLabel('Field with hover')).toBeVisible({ timeout: TIMEOUT });
// Click Change locators button to test healing
const submitBtn = page.locator('#Submit');
await submitBtn.click();
// Test healing - same action should work after locator change
await expect(page.getByLabel('Field with hover')).toBeVisible({ timeout: TIMEOUT });
});
test('getByPlaceholder', async ({ page }) => {
test.slow();
await expect(page.getByPlaceholder('Change: TestId')).toBeVisible({ timeout: TIMEOUT });
// Click Change locators button to test healing
const submitBtn = page.locator('#Submit');
await submitBtn.click();
// Test healing - same action should work after locator change
await expect(page.getByPlaceholder('Change: TestId')).toBeVisible({ timeout: TIMEOUT });
});
test('getByAltText', async ({ page }) => {
test.slow();
await expect(page.getByAltText('Healenium Logo')).toBeVisible({ timeout: TIMEOUT });
// Click Change locators button to test healing
const submitBtn = page.locator('#Submit');
await submitBtn.click();
// Test healing - same action should work after locator change
await expect(page.getByAltText('Healenium Logo')).toBeVisible({ timeout: TIMEOUT });
});
test('getByTitle', async ({ page }) => {
test.slow();
await expect(page.getByTitle('Validate change test id')).toBeVisible({ timeout: TIMEOUT });
// Click Change locators button to test healing
const submitBtn = page.locator('#Submit');
await submitBtn.click();
// Test healing - same action should work after locator change
await expect(page.getByTitle('Validate change test id')).toBeVisible({ timeout: TIMEOUT });
});
test('getByTestId', async ({ page }) => {
test.slow();
await expect(page.getByTestId('change_testId')).toBeVisible({ timeout: TIMEOUT });
// Click Change locators button to test healing
const submitBtn = page.locator('#Submit');
await submitBtn.click();
// Test healing - same action should work after locator change
await expect(page.getByTestId('change_testId')).toBeVisible({ timeout: TIMEOUT });
});
});
import { test, expect } from '@playwright/test';
import { gotoTestEnv, TEST_ENV_URL } from '../../helpers/goto';

const TIMEOUT = 5000;

test.describe('Locator API - getBy - Tests', () => {
test.beforeEach(async ({ page }) => {
await gotoTestEnv(page, TEST_ENV_URL);
});

test('getByRole - img - alt', async ({ page }) => {
test.slow();
await expect(page.getByRole('img', { name: 'Healenium Logo' })).toBeVisible({ timeout: TIMEOUT });

// Click Change locators button to test healing
const submitBtn = page.locator('#Submit');
await submitBtn.click();

// Test healing - same action should work after locator change
await expect(page.getByRole('img', { name: 'Healenium Logo' })).toBeVisible({ timeout: TIMEOUT });
});

test('getByRole - textbox - aria label', async ({ page }) => {
test.slow();
await expect(page.getByRole('textbox', { name: 'change_tag_aria_label' })).toBeVisible({ timeout: TIMEOUT });

// Click Change locators button to test healing
const submitBtn = page.locator('#Submit');
await submitBtn.click();

// Test healing - same action should work after locator change
await expect(page.getByRole('textbox', { name: 'change_tag_aria_label' })).toBeVisible({ timeout: TIMEOUT });
});

test('getByRole - textbox - aria labelledby', async ({ page }) => {
test.slow();
await expect(page.getByRole('textbox', { name: 'Field labeled by' })).toBeVisible({ timeout: TIMEOUT });

// Click Change locators button to test healing
const submitBtn = page.locator('#Submit');
await submitBtn.click();

// Test healing - same action should work after locator change
await expect(page.getByRole('textbox', { name: 'Field labeled by' })).toBeVisible({ timeout: TIMEOUT });

});

test('getByText', async ({ page }) => {
test.slow();
await expect(page.locator('div.draggable-item.green-item')).toBeVisible({ timeout: TIMEOUT });

// Click Change locators button to test healing
const submitBtn = page.locator('#Submit');
await submitBtn.click();

// Test healing - same action should work after locator change
await expect(page.locator('div.draggable-item.green-item')).toBeVisible({ timeout: TIMEOUT });
});

test('getByLabel', async ({ page }) => {
test.slow();
await expect(page.getByLabel('Field with hover')).toBeVisible({ timeout: TIMEOUT });

// Click Change locators button to test healing
const submitBtn = page.locator('#Submit');
await submitBtn.click();

// Test healing - same action should work after locator change
await expect(page.getByLabel('Field with hover')).toBeVisible({ timeout: TIMEOUT });

});

test('getByPlaceholder', async ({ page }) => {
test.slow();
await expect(page.getByPlaceholder('Change: TestId')).toBeVisible({ timeout: TIMEOUT });

// Click Change locators button to test healing
const submitBtn = page.locator('#Submit');
await submitBtn.click();

// Test healing - same action should work after locator change
await expect(page.getByPlaceholder('Change: TestId')).toBeVisible({ timeout: TIMEOUT });
});

test('getByAltText', async ({ page }) => {
test.slow();
await expect(page.getByAltText('Healenium Logo')).toBeVisible({ timeout: TIMEOUT });

// Click Change locators button to test healing
const submitBtn = page.locator('#Submit');
await submitBtn.click();

// Test healing - same action should work after locator change
await expect(page.getByAltText('Healenium Logo')).toBeVisible({ timeout: TIMEOUT });
});

test('getByTitle', async ({ page }) => {
test.slow();
await expect(page.getByTitle('Validate change test id')).toBeVisible({ timeout: TIMEOUT });

// Click Change locators button to test healing
const submitBtn = page.locator('#Submit');
await submitBtn.click();

// Test healing - same action should work after locator change
await expect(page.getByTitle('Validate change test id')).toBeVisible({ timeout: TIMEOUT });
});

test('getByTestId', async ({ page }) => {
test.slow();
await expect(page.getByTestId('change_testId')).toBeVisible({ timeout: TIMEOUT });

// Click Change locators button to test healing
const submitBtn = page.locator('#Submit');
await submitBtn.click();

// Test healing - same action should work after locator change
await expect(page.getByTestId('change_testId')).toBeVisible({ timeout: TIMEOUT });
});

});