Skip to content

Commit

Permalink
Fix bug in TheiaDialog page object (#12753)
Browse files Browse the repository at this point in the history
Fix bug with the `TheiaDialog.waitUntilMainButtonIsEnabled` method not working as expected (infinite timeout).
Call `waitUntilMainButtonIsEnabled` in `TheiaExplorView.renameNode` to ensure that the method is covered by the test case execution.
  • Loading branch information
tortmayr authored Jul 26, 2023
1 parent 86567e3 commit 0860f57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/playwright/src/theia-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ export class TheiaDialog extends TheiaPageObject {
}

async waitUntilMainButtonIsEnabled(): Promise<void> {
await this.page.waitForFunction(() => {
const button = document.querySelector<HTMLButtonElement>(`${this.controlSelector} > button.theia-button.main`);
await this.page.waitForFunction(predicate => {
const button = document.querySelector<HTMLButtonElement>(predicate.buttonSelector);
return !!button && !button.disabled;
});
}, { buttonSelector: `${this.controlSelector} > button.theia-button.main` });
}

}
1 change: 1 addition & 0 deletions examples/playwright/src/theia-explorer-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ export class TheiaExplorerView extends TheiaView {
const renameDialog = new TheiaRenameDialog(this.app);
await renameDialog.waitForVisible();
await renameDialog.enterNewName(newName);
await renameDialog.waitUntilMainButtonIsEnabled();
confirm ? await renameDialog.confirm() : await renameDialog.close();
await renameDialog.waitForClosed();
await this.refresh();
Expand Down

0 comments on commit 0860f57

Please sign in to comment.