Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

how to select Language #212

Closed
gpBlockchain opened this issue Dec 9, 2022 · 3 comments · Fixed by #241
Closed

how to select Language #212

gpBlockchain opened this issue Dec 9, 2022 · 3 comments · Fixed by #241
Labels
bug Something isn't working P0 Critical. Tacked by core team

Comments

@gpBlockchain
Copy link

gpBlockchain commented Dec 9, 2022

commit:2d86a6d
Describe the problem
I can't use it, because my metaMesk language is Chinese,how do I change the language of metamask
image

npm run test

> @chainsafe/dappeteer@3.0.0 test
> mocha

(node:12908) DeprecationWarning: Configuration via mocha.opts is DEPRECATED and will be removed from a future version of Mocha. Use RC files or package.json instead.
(Use `node --trace-deprecation ...` to show where the warning was created)


  dappeteer
Starting ganache...
Ganache running at http://localhost:8545
Starting test server...
Server running at http://localhost:8080
Deploying test contract...
web3-shh package will be deprecated in version 1.3.5 and will no longer be supported.
web3-bzz package will be deprecated in version 1.3.5 and will no longer be supported.
Contract deployed at 0x0fC7E4bD0784Af9b444015557CDBdA05d9D4D46e
path: /Users/guopenglin/test/e2e/dappeteer/test/dapp/data.js

Running tests on MetaMask version v10.15.0

    1) "before all" hook for "should be deployed, contract"


  0 passing (34s)
  1 failing

  1) dappeteer
       "before all" hook for "should be deployed, contract":
     TimeoutError: waiting for XPath `//button[contains(text(), 'Get Started')]` failed: timeout 30000ms exceeded
      at new WaitTask (node_modules/puppeteer/src/common/DOMWorld.ts:813:28)
      at DOMWorld.waitForXPath (node_modules/puppeteer/src/common/DOMWorld.ts:702:22)
      at Frame.waitForXPath (node_modules/puppeteer/src/common/FrameManager.ts:1327:47)
      at Page.waitForXPath (node_modules/puppeteer/src/common/Page.ts:3281:29)
      at getElementByContent (src/helpers/selectors.ts:5:8)
      at /Users/guopenglin/test/e2e/dappeteer/src/helpers/actions.ts:33:43
      at Generator.next (<anonymous>)
      at /Users/guopenglin/test/e2e/dappeteer/src/helpers/actions.ts:8:71
      at new Promise (<anonymous>)
      at __awaiter (src/helpers/actions.ts:4:12)
      at clickOnButton (src/helpers/actions.ts:32:80)
      at /Users/guopenglin/test/e2e/dappeteer/src/setup/setupActions.ts:22:22
      at Generator.next (<anonymous>)
      at /Users/guopenglin/test/e2e/dappeteer/src/setup/setupActions.ts:8:71
      at new Promise (<anonymous>)
      at __awaiter (src/setup/setupActions.ts:4:12)
      at confirmWelcomeScreen (src/setup/setupActions.ts:24:12)
      at Object.<anonymous> (src/setup/setupMetamask.ts:23:11)
      at Generator.next (<anonymous>)
      at fulfilled (src/setup/setupMetamask.ts:5:58)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)



@gpBlockchain gpBlockchain added the help wanted Extra attention is needed label Dec 9, 2022
@BeroBurny
Copy link
Contributor

Issues are with browser preferences, try to switch the system to English till the issue is resolved.

@BeroBurny
Copy link
Contributor

anyone who is going to take over a task needs to add one of these args (found best fitted for it)

https://peter.sh/experiments/chromium-command-line-switches/#accept-lang
https://peter.sh/experiments/chromium-command-line-switches/#lang
https://peter.sh/experiments/chromium-command-line-switches/#override-language-detection

@BeroBurny BeroBurny added bug Something isn't working P0 Critical. Tacked by core team and removed help wanted Extra attention is needed labels Dec 9, 2022
@gpBlockchain gpBlockchain reopened this Dec 9, 2022
@Lykhoyda
Copy link
Contributor

@gpBlockchain thank you for your question. To change the language you have to provide an accept-lang argument to puppeteer and playwright options during the initial bootstrap method call:

await dappeteer.bootstrap({
      .... // other parameters,
      playwrightOptions: {
        args: ["--accept-lang=en"],
      },
      puppeteerOptions: {
        args: ["--accept-lang=en"],
      },
    });

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working P0 Critical. Tacked by core team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants