Skip to content

Commit

Permalink
test: Refactor EditAccountNameView for E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
devin-ai-integration[bot] committed Oct 11, 2024
1 parent 87b82d9 commit ede7fe3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
24 changes: 13 additions & 11 deletions e2e/pages/EditAccountNameView.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@ import Matchers from '../utils/Matchers';
import Gestures from '../utils/Gestures';
import EditAccountNameSelectorIDs from '../selectors/EditAccountName.selectors';

export default class EditAccountNameView {
static async saveButton() {
return await Matchers.getElementByID(
EditAccountNameSelectorIDs.EDIT_ACCOUNT_NAME_SAVE,
);
class EditAccountNameView {
get saveButton() {
return Matchers.getElementByID(EditAccountNameSelectorIDs.EDIT_ACCOUNT_NAME_SAVE);
}

static async tapSave() {
await Gestures.waitAndTap(this.saveButton());
async tapSave() {
await Gestures.waitAndTap(this.saveButton);
}

static async accountNameInput() {
return await Matchers.getElementByID(
EditAccountNameSelectorIDs.ACCOUNT_NAME_INPUT,
);
get accountNameInput() {
return Matchers.getElementByID(EditAccountNameSelectorIDs.ACCOUNT_NAME_INPUT);
}

async typeAccountName(name) {
await Gestures.typeText(this.accountNameInput, name);
}
}

export default new EditAccountNameView();
2 changes: 1 addition & 1 deletion e2e/specs/accounts/change-account-name.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe(Regression('Change Account Name'), () => {
// Open account actions and edit account name
await WalletView.tapMainWalletAccountActions();
await AccountActionsModal.tapEditAccount();
await Gestures.clearField(EditAccountNameView.accountNameInput());
await Gestures.clearField(EditAccountNameView.accountNameInput);
await TestHelpers.typeTextAndHideKeyboard(
EditAccountNameSelectorIDs.ACCOUNT_NAME_INPUT,
NEW_ACCOUNT_NAME,
Expand Down

0 comments on commit ede7fe3

Please sign in to comment.