-
Notifications
You must be signed in to change notification settings - Fork 153
Viewport height and width setup, tests failing remotly #208
Description
Locally initSnapEnv installs snap properly, remotly on github actions it fails.
It's impossible to scroll to see button in viewport even locally, but button can still be found ("Approve & install") and test work locally.
dappeteer.page.setViewport({height: 1500, width: 600}) in beforeAll()
sets viewport to late
To Reproduce
Steps to reproduce the behavior:
ChainSafe/test-snaps#2
node_modules/@chainsafe/dappeteer/dist/snap/install.js
if (opts.hasPermissions) {
await page.waitForSelector('button');
//ADD THIS TIMEOUT, LINE BELOW
await new Promise((res) => setTimeout(res, 20000));
await (0, helpers_1.clickOnButton)(page, "Approve & install");
stretch screen manually to se "Approve & install" button, scroll doesn't work
Github action logs ChainSafe/test-snaps#2
Logs
➤ YN0000: [@metamask/test-snap-confirm]: TimeoutError: page.waitForSelector: Timeout 20000ms exceeded.
➤ YN0000: [@metamask/test-snap-confirm]: =========================== logs ===========================
➤ YN0000: [@metamask/test-snap-confirm]: waiting for locator('xpath=//button[contains(text(), \'Approve & install\')]') to be visible
➤ YN0000: [@metamask/test-snap-confirm]: ============================================================page.waitForSelector: Timeout 20000ms exceeded.
➤ YN0000: [@metamask/test-snap-confirm]: =========================== logs ===========================
➤ YN0000: [@metamask/test-snap-confirm]: waiting for locator('xpath=//button[contains(text(), \'Approve & install\')]') to be visible
➤ YN0000: [@metamask/test-snap-confirm]: ============================================================
➤ YN0000: [@metamask/test-snap-confirm]:
➤ YN0000: [@metamask/test-snap-confirm]: 15 |
➤ YN0000: [@metamask/test-snap-confirm]: 16 | beforeAll(async function () {
➤ YN0000: [@metamask/test-snap-confirm]: > [17](https://github.com/ChainSafe/test-snaps/actions/runs/3621333956/jobs/6104663928#step:5:18) | ({ dappeteer, snapId, browser } = await initSnapEnv({
Expected behavior
initSnapEnv could have viewport in opts: DappeteerLaunchOptions to force height, maybe then tests wouldn't fail remotly
System:
- OS: [e.g. iOS]
- OS version [e.g. 22]
- NodeJs version [e.g v15.8.0]
- dAppeteer version [e.g. 2.2.0]
- testing framework [e.g jest]
- testing framework version [e.g 26.0]
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status

