Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/components/FieldBuilderTable/FieldBuilderTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const FieldBuilderTable: FC<FieldBuilderTableProps<FormData>> = ({
const removeButtonTip = removeButton.tooltip?.(rowIndex);
const button = (
<Button
data-testid={`remove-row-${rowIndex}`}
icon={
<Icon size="md">
<MinusCircleIcon />
Expand Down
1 change: 1 addition & 0 deletions src/components/NodeSelectorModal/LabelRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const LabelRow: FC<LabelRowProps> = ({ isLabelsVisible, label, onChange, onDelet
<GridItem span={1}>
<FormGroup label={isLabelsVisible && ' '}>
<Button
data-testid="node-selector-delete-button"
icon={<MinusCircleIcon />}
onClick={() => {
onDelete(id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const ScriptsSection: FC<ScriptsSectionProps> = ({ configMap, plan, scripts }) =
))}
</>
) : (
<Content component="p" className="pf-v6-u-color-200">
<Content component="p" className="pf-v6-u-color-200" data-testid="scripts-none">
{t('No customization scripts are configured.')}
</Content>
)}
Expand Down
6 changes: 3 additions & 3 deletions testing/playwright/e2e/downstream/i18n-smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ test.describe('i18n β€” translations smoke test', { tag: '@downstream' }, () =>
const welcomeHeading = page.getByRole('heading', { name: locale.Welcome });
await expect(welcomeHeading).toBeVisible({ timeout: ELEMENT_VISIBLE_TIMEOUT_MS });

const createPlanButton = page.getByRole('button', {
name: locale['Create migration plan'],
const migrationPlansCard = page.getByText(locale['Migration plans']);
await expect(migrationPlansCard.first()).toBeVisible({
timeout: ELEMENT_VISIBLE_TIMEOUT_MS,
});
await expect(createPlanButton).toBeVisible();
});

await test.step('Verify Providers page translations', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class ScriptEditModal extends BaseModal {

constructor(page: Page) {
super(page, page.getByTestId('script-edit-modal'));
this.addScriptButton = this.page.getByTestId('add-script-button');
this.addScriptButton = this.modal.getByTestId('add-mapping-button');
}

async addScript(): Promise<void> {
Expand All @@ -27,11 +27,11 @@ export class ScriptEditModal extends BaseModal {
}

async getScriptCount(): Promise<number> {
return await this.page.locator('[data-testid^="script-edit-row-"]').count();
return await this.modal.locator('[data-testid^="field-row-"]').count();
}

async removeScript(index: number): Promise<void> {
await this.page.getByTestId(`remove-script-${index}`).click();
await this.modal.getByTestId(`remove-row-${index}`).click();
}

async setScripts(scripts: ScriptConfig[]): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,13 @@ export class TargetNodeSelectorModal extends BaseModal {

async deleteNodeSelectorByKey(key: string): Promise<void> {
const keyInputs = this.modal.getByTestId('node-selector-key-input');
const deleteButtons = this.modal.getByTestId('node-selector-delete-button');
const count = await keyInputs.count();

for (let i = 0; i < count; i += 1) {
const inputValue = await keyInputs.nth(i).inputValue();
if (inputValue === key) {
const deleteButton = this.modal
.locator('button')
.filter({ has: this.page.locator('svg') })
.nth(i);
await deleteButton.click();
await deleteButtons.nth(i).click();
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ export class AutomationTab {
}

async verifyNoScripts(): Promise<void> {
await expect(this.page.getByTestId('scripts-none')).toContainText('None');
await expect(this.page.getByTestId('scripts-none')).toContainText(
'No customization scripts are configured',
);
}

async verifyScriptDetails(
Expand Down
8 changes: 8 additions & 0 deletions testing/playwright/test-assets/hook_template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- name: "{{ hook_name }}"
hosts: localhost
connection: local
tasks:
- name: Log migration hook execution
debug:
msg: "Executing hook: {{ hook_name }}"
Loading