Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't add network in docker container #224

Closed
shawnwang0715 opened this issue Sep 21, 2021 · 5 comments
Closed

Can't add network in docker container #224

shawnwang0715 opened this issue Sep 21, 2021 · 5 comments

Comments

@shawnwang0715
Copy link
Contributor

Sorry, I can't find a way to re-open the issue in #215, so I create a new one.

When I try to add a network in docker container, it always gets stuck in here:

await puppeteer.waitForText(
mainPageElements.networkSwitcher.networkName,
network.networkName,

Here's my docker-compose.yml:

services:
  synpress:
    image: synthetixio/docker-e2e:14.17-debian
    volumes:
      - './synpress:/home/app'
      - './synpress/node_modules:/home/node/app/node_modules'
    entrypoint: ["tail", "-f", "/dev/null"]
    environment:
      - SECRET_WORDS="test test test test test test test test test test test junk"
      - NETWORK_NAME="Smart Chain"
      - RPC_URL="https://bsc-dataseed.binance.org/"
      - CHAIN_ID="56"
      - SYMBOL="BNB"
      - BLOCK_EXPLORER="https://bscscan.com"

After starting the docker container, I run these commands:

npm i @synthetixio/synpress
npx synpress run --browser chrome --configFile 'tests/e2e/synpress.json'

My synpress.json has nothing special. I only changed the baseUrl

Then I always get

     CypressError: `cy.screenshot()` timed out waiting `30000ms` to complete.

Because this error occurred during a `before all` hook we are skipping all of the remaining tests.

Although you have test retries enabled, we do not retry tests when `before all` or `after all` hooks fail

Could you check whether adding network works in docker? Thanks!

@shawnwang0715
Copy link
Contributor Author

OK, I figured out why.

There's nothing wrong with the code, but my configurations.
Heres's some tips for any other people who have similar issues:

  1. Try to set a valid BLOCK_EXPLORER. Although it's optional, somehow leave it as a blank value may make you get stuck when adding a new network.
  2. Check the RPC_URL and CHAIN_ID are accessible in your docker container. You may have a different network environment between the host and the docker container.
  3. Always use a lower case NETWORK_NAME!!! This is very important, I got stuck for over two weeks because I set the NETWORK_NAME with both uppercase and lower case. This would make synpress can't find the network name.

@drptbl
Copy link
Member

drptbl commented Oct 7, 2021

Hey @shawnwang0715, thank you very much for this information ❤️. I will make sure to fix these two issues from points 1 and 3.

For point 2, this is not an issue. Synpress uses kovan by default, so if you don't pass these env vars to docker image, it will obviously use default network which is kovan.

I will make sure to fix this in upcoming synpress release (ETA next week).

btw. sorry for not looking in to it earlier. I'm currently a little bit busy with other stuff.

Cheers,
Jakub.

@shawnwang0715
Copy link
Contributor Author

Hey @drptbl, I'm not sure whether this is an issue, but when I tried to enter the wrong values (for example, a RPC_URL without http:// or https:// prefix) to a custom network, synpress can still continue the process (click save button, although it's not clickable in GUI) without any warning or error messages.
And then, synpress tries to wait for the custom network to appear in the drop-down menu, which is not possible (because the custom network can't be added successfully); that's why I thought I got stuck.

Maybe displaying error messages in the console would help other devs when they using docker. How do you think?

Regards,

@drptbl
Copy link
Member

drptbl commented Oct 8, 2021

@shawnwang0715 Yeah, for sure. Synpress error handling has to be improved and be more descriptive to avoid long debugging process.

@drptbl
Copy link
Member

drptbl commented Nov 1, 2021

Hey @shawnwang0715, I've addressed all issues you've described above. Sorry for delay!

You can check it out using @synthetixio/synpress@1.0.2.

Thanks for awesome feedback 🙏.

All Best,
Jakub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants