From 663fe2dd019533eba39e42e3f44b320b7235f7cf Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 30 Apr 2024 16:37:55 +0200 Subject: [PATCH] fix test --- apps/remix-ide-e2e/src/tests/ballot.test.ts | 2 ++ apps/remix-ide-e2e/src/tests/erc721.test.ts | 2 ++ apps/remix-ide-e2e/src/tests/workspace.test.ts | 15 +++++++++++++++ .../remix-ide-e2e/src/tests/workspace_git.test.ts | 2 ++ .../src/app/plugins/templates-selection.tsx | 2 +- 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/ballot.test.ts b/apps/remix-ide-e2e/src/tests/ballot.test.ts index c9fb7c27bc..db34e18cf3 100644 --- a/apps/remix-ide-e2e/src/tests/ballot.test.ts +++ b/apps/remix-ide-e2e/src/tests/ballot.test.ts @@ -102,6 +102,8 @@ module.exports = { .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') .scrollAndClick('*[data-id="modalDialogCustomPromptTextCreate"]') .setValue('*[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_remix_default') + // eslint-disable-next-line dot-notation + .execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_remix_default' }) .modalFooterOKClick('TemplatesSelection') .pause(1000) .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]') diff --git a/apps/remix-ide-e2e/src/tests/erc721.test.ts b/apps/remix-ide-e2e/src/tests/erc721.test.ts index 890a5e7fc3..8a3861a1c8 100644 --- a/apps/remix-ide-e2e/src/tests/erc721.test.ts +++ b/apps/remix-ide-e2e/src/tests/erc721.test.ts @@ -22,6 +22,8 @@ module.exports = { .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') .scrollAndClick('*[data-id="modalDialogCustomPromptTextCreate"]') .setValue('*[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_erc721') + // eslint-disable-next-line dot-notation + .execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_erc721' }) .modalFooterOKClick('TemplatesSelection') .pause(100) .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]') diff --git a/apps/remix-ide-e2e/src/tests/workspace.test.ts b/apps/remix-ide-e2e/src/tests/workspace.test.ts index 094b35a080..e9517e90e2 100644 --- a/apps/remix-ide-e2e/src/tests/workspace.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace.test.ts @@ -43,6 +43,8 @@ module.exports = { .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') .scrollAndClick('*[data-id="modalDialogCustomPromptTextCreate"]') .setValue('*[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_remix_default') + // eslint-disable-next-line dot-notation + .execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_remix_default' }) .modalFooterOKClick('TemplatesSelection') .pause(1000) .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]') @@ -115,6 +117,8 @@ module.exports = { .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') .scrollAndClick('*[data-id="modalDialogCustomPromptTextCreate"]') .setValue('*[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_blank') + // eslint-disable-next-line dot-notation + .execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_blank' }) .modalFooterOKClick('TemplatesSelection') .pause(100) .waitForElementPresent('*[data-id="treeViewUltreeViewMenu"]') @@ -136,6 +140,8 @@ module.exports = { .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') .scrollAndClick('*[data-id="modalDialogCustomPromptTextCreate"]') .setValue('*[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_erc20') + // eslint-disable-next-line dot-notation + .execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_erc20' }) .modalFooterOKClick('TemplatesSelection') .pause(100) .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]') @@ -195,6 +201,8 @@ module.exports = { .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') .scrollAndClick('*[data-id="modalDialogCustomPromptTextCreate"]') .setValue('*[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_erc721') + // eslint-disable-next-line dot-notation + .execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_erc721' }) .modalFooterOKClick('TemplatesSelection') .pause(100) .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]') @@ -254,6 +262,8 @@ module.exports = { .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') .scrollAndClick('*[data-id="modalDialogCustomPromptTextCreate"]') .setValue('*[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_erc1155') + // eslint-disable-next-line dot-notation + .execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_erc1155' }) .modalFooterOKClick('TemplatesSelection') .pause(100) .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]') @@ -484,6 +494,7 @@ module.exports = { .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') .scrollAndClick('*[data-id="modalDialogCustomPromptTextCreate"]') .setValue('*[data-id="modalDialogCustomPromptTextCreate"]', 'sometestworkspace') + .execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'sometestworkspace' }) .modalFooterOKClick('TemplatesSelection') .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts/MyToken.sol"]') @@ -510,6 +521,8 @@ module.exports = { .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') .scrollAndClick('*[data-id="modalDialogCustomPromptTextCreate"]') .setValue('*[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_db_test') + // eslint-disable-next-line dot-notation + .execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_db_test' }) .modalFooterOKClick('TemplatesSelection') .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]') .waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts/MyToken.sol"]') @@ -538,6 +551,8 @@ module.exports = { .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') .scrollAndClick('*[data-id="modalDialogCustomPromptTextCreate"]') .setValue('*[data-id="modalDialogCustomPromptTextCreate"]', 'multisig cookbook') + // eslint-disable-next-line dot-notation + .execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'multisig cookbook' }) .modalFooterOKClick('TemplatesSelection') .waitForElementVisible('[data-id="PermissionHandler-modal-footer-ok-react"]', 300000) .click('[data-id="PermissionHandler-modal-footer-ok-react"]') diff --git a/apps/remix-ide-e2e/src/tests/workspace_git.test.ts b/apps/remix-ide-e2e/src/tests/workspace_git.test.ts index 467d97e620..bf5da591e9 100644 --- a/apps/remix-ide-e2e/src/tests/workspace_git.test.ts +++ b/apps/remix-ide-e2e/src/tests/workspace_git.test.ts @@ -53,6 +53,8 @@ module.exports = { .waitForElementVisible('*[data-id="modalDialogCustomPromptTextCreate"]') .scrollAndClick('*[data-id="modalDialogCustomPromptTextCreate"]') .setValue('*[data-id="modalDialogCustomPromptTextCreate"]', 'workspace_blank') + // eslint-disable-next-line dot-notation + .execute(function () { document.querySelector('*[data-id="modalDialogCustomPromptTextCreate"]')['value'] = 'workspace_blank' }) .click('[data-id="initGitRepositoryLabel"]') .modalFooterOKClick('TemplatesSelection') .pause(100) diff --git a/apps/remix-ide/src/app/plugins/templates-selection.tsx b/apps/remix-ide/src/app/plugins/templates-selection.tsx index e1192e0693..a68b47fb75 100644 --- a/apps/remix-ide/src/app/plugins/templates-selection.tsx +++ b/apps/remix-ide/src/app/plugins/templates-selection.tsx @@ -341,7 +341,7 @@ export class TemplatesSelection extends ViewPlugin { const email = await this.call('settings', 'get', 'settings/github-email') const gitNotSet = !username || !email let workspaceName = defaultName - let initGit = true + let initGit = false const modal: AppModal = { id: 'TemplatesSelection', title: window._intl.formatMessage({ id: !isElectron() ? 'filePanel.workspace.create': 'filePanel.workspace.create.desktop' }),