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

Running in headed mobile view doesn't maintain screen size #4273

Closed
rob4629 opened this issue Sep 12, 2019 · 19 comments
Closed

Running in headed mobile view doesn't maintain screen size #4273

rob4629 opened this issue Sep 12, 2019 · 19 comments
Assignees
Labels
STATE: Need clarification An issue lacks information for further research.

Comments

@rob4629
Copy link
Contributor

rob4629 commented Sep 12, 2019

What is your Test Scenario?

I'm trying to test our website in mobile view ( e.g. 'chrome:emulation:device=iphone X'). The tests run without any problems (both headless and headed mode. My issue relates to trying to debug the tests in headed mode...

What is the Current behavior?

The screen resolution constantly switches between web and mobile view (but maintaining the window size), making it impossible to actually interact with the website in debug mode.

What is the Expected behavior?

I would expect the screen resolution to remain in mobile view mode, rather than switching between mobile and web views.

What is your web application and your TestCafe test code?

Your website URL (or attach your complete example):
I've been testing www.change.org, however I can observe the same behaviour with Google

Your complete test code (or attach your test files):
 test('This is a demo test', async () => {
  await t
    .navigateTo('www.google.com');
  await t.debug();
});
Your complete configuration file (if any):

Your complete test report:

Screenshots:
![Screen Shot 2019-09-12 at 2 53 16 PM](https://user-images.githubusercontent.com/37812673/64824543-35127900-d56f-11e9-8fcf-8d9688074c92.png)
![Screen Shot 2019-09-12 at 2 53 11 PM](https://user-images.githubusercontent.com/37812673/64824556-39d72d00-d56f-11e9-99d6-819999252183.png)

Steps to Reproduce:

  1. Add a debug to your test (or an intentional failure)
  2. Run testcafe 'chrome:emulation:device=iphone X' --debug-on-fail
  3. Observe the run, and attempt to interact with the browser window during debug

Your Environment details:

  • testcafe version: 1.4.1
  • node.js version: 10.15.3
  • command-line arguments: testcafe 'chrome:emulation:device=iphone X' --debug-on-fail
  • browser name and version: Chrome 76.0.3...
  • platform and version: macOS 10.14
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Sep 12, 2019
@VasilyStrelyaev VasilyStrelyaev self-assigned this Sep 16, 2019
@VasilyStrelyaev
Copy link
Collaborator

Thank you for reporting this issue. However, I cannot reproduce the behavior you described.
 
I tried the following test:
 

import { Selector } from 'testcafe';
 
fixture `My fixture`;
 
test('This is a demo test', async t => {
    await t
        .navigateTo('https://www.change.org')
        .debug()
        .click('.js-sap-link')
        .click(Selector('div').withAttribute('data-testid', 'Human rights'));
});

 
I ran it with both the portrait and landscape orientations in iPhone X emulation mode.
 
The browser didn't switch to the web view when I resized the window. In landscape mode, I unlocked the page and clicked some buttons. The page remained in the mobile view.
 
Could you please describe how you interact with the browser window? Do you resize it? Do you use the 'Unlock page' button in the footer and then interact with the page?

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Sep 16, 2019
@VasilyStrelyaev VasilyStrelyaev removed their assignment Sep 16, 2019
@VasilyStrelyaev VasilyStrelyaev added the STATE: Need clarification An issue lacks information for further research. label Sep 16, 2019
@rob4629
Copy link
Contributor Author

rob4629 commented Sep 24, 2019

Our tests don't resize the browser or run it using any particular settings, here's an example of our tests:

await t
    .navigateTo('/start-a-petition?tag_selected=none')
    .typeText(this.petitionAsk, 'Some Petition Title')
    .click(this.saveContinueButton)
    .typeText(this.chooseDMs, 'Some Name')
    .pressKey('tab')
    .click(this.saveContinueButton)
    .switchToIframe(this.descriptionFrame)
    .typeText(this.descriptionTextBox, 'Some description')
    .switchToMainWindow()
    .click(this.saveContinueButton);

I can provide the Selectors for this test, but the point I'm making is we're not manipulating the browser during the test. I'm unsure why I'm seeing the weird re-sizing issue when running in headed mode and you're not... I've checked out your source code so will try to run again using that to see if there's any difference.

@no-response no-response bot removed the STATE: Need clarification An issue lacks information for further research. label Sep 24, 2019
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Sep 24, 2019
@alexey-lin alexey-lin self-assigned this Sep 25, 2019
@alexey-lin
Copy link
Contributor

alexey-lin commented Sep 25, 2019

Hi @rob4629,
 
I tried to reproduce the issue using the test example you posted, but without success. We'd be happy to help you, but we need to be able to reproduce this problem first.
I see that you are working with TestCafe v1.4.1. Сould you try to update to the latest TestCafe version (v1.5.0) and check if it solves the problem?

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Sep 25, 2019
@alexey-lin alexey-lin added the STATE: Need clarification An issue lacks information for further research. label Sep 25, 2019
@rob4629
Copy link
Contributor Author

rob4629 commented Sep 25, 2019 via email

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Sep 25, 2019
@miherlosev miherlosev removed the STATE: Need response An issue that requires a response or attention from the team. label Sep 26, 2019
@no-response
Copy link

no-response bot commented Oct 5, 2019

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@no-response no-response bot closed this as completed Oct 5, 2019
@rob4629
Copy link
Contributor Author

rob4629 commented Dec 10, 2019

Hi 👋,

I'm returned to testing mobile emulation (now using TC v1.7.0), and this issue is still occuring. I've recorded a video of the screen, and the command I'm using is:

testcafe 'chrome:emulation:device=iphone X'

iPhone emulation in headed mode.mov.zip

This is causing me issues, as I'm trying to debug failures in Mobile mode where TC can't see the DOM elements (however manually testing our site in Google's device emulation works).

@no-response no-response bot removed the STATE: Need clarification An issue lacks information for further research. label Dec 10, 2019
@no-response no-response bot reopened this Dec 10, 2019
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Dec 10, 2019
@LavrovArtem LavrovArtem self-assigned this Dec 12, 2019
@LavrovArtem
Copy link
Contributor

LavrovArtem commented Dec 12, 2019

Hi,
I'm not able to reproduce this behavior on macOS in Chrome. By your video, it seems like the devicePixelRatio property somehow is changing. Could you please provide us the full test script for reproducing this issue?

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Dec 12, 2019
@LavrovArtem LavrovArtem added the STATE: Need clarification An issue lacks information for further research. label Dec 12, 2019
@rob4629
Copy link
Contributor Author

rob4629 commented Dec 12, 2019

I was able to reproduce it just by starting on www.google.ca:

  1. Enter text in the search box
  2. Click search
  3. Check search list is visible

The constant resizing occurs from the moment Google page loads...

We can jump on a zoom call and go through it, if that will help... but it seems to be happening for others in my office when running the same command line args:

testcafe 'chrome:emulation:device=iphone X'

🤷‍♂

@no-response no-response bot removed the STATE: Need clarification An issue lacks information for further research. label Dec 12, 2019
@miherlosev miherlosev added the STATE: Need clarification An issue lacks information for further research. label Dec 13, 2019
@no-response
Copy link

no-response bot commented Dec 23, 2019

This issue was automatically closed because there was no response to our request for more information from the original author. Currently, we don't have enough information to take action. Please reach out to us if you find the necessary information and are able to share it. We are also eager to know if you resolved the issue on your own and can share your findings with everyone.

@no-response no-response bot closed this as completed Dec 23, 2019
@rob4629
Copy link
Contributor Author

rob4629 commented Feb 20, 2020

Sorry for the delay. I'll try to get a reproducible example up shortly (as this is still something I experience).

@no-response no-response bot removed the STATE: Need clarification An issue lacks information for further research. label Feb 20, 2020
@no-response no-response bot reopened this Feb 20, 2020
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Feb 20, 2020
@AlexSkorkin AlexSkorkin removed the STATE: Need response An issue that requires a response or attention from the team. label Feb 21, 2020
@rob4629
Copy link
Contributor Author

rob4629 commented Feb 21, 2020

Can you run the following test, against our site, please? This is consistently presenting the resizing issue I've mentioned.

I'm using the latest TestCafe (1.8.2) against Chrome 80.0.3987.116

Command: testcafe 'chrome:emulation:device=iphone X'

import { Selector, t } from 'testcafe';

fixture('Verify the Careers page is working').page('https://www.change.org/');

test('Load the careers page, and apply for first available job', async () => {
  const openings = Selector('#openings');
  const firstAvailableJob = openings.child().find('a');

  // Job Application
  const submitApplicationForm = Selector('.application-form').filterVisible();
  const submitApplicationHeader = submitApplicationForm.find('h4');

  await t
    .navigateTo('/careers')
    .expect(openings.visible)
    .ok()
    .click(firstAvailableJob)
    .click(Selector('a').withText('Apply now'));

  await t.expect(submitApplicationHeader.innerText).ok();
});

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Feb 21, 2020
@AlexSkorkin
Copy link
Collaborator

Thank you for the update, Rob.

Here's what I see when I run your test. The browser is not resized when the test is started, running, stopped on fail, and when I unlock the page.

image

image

image

image

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Feb 24, 2020
@AlexSkorkin AlexSkorkin added the STATE: Need clarification An issue lacks information for further research. label Feb 24, 2020
@rob4629
Copy link
Contributor Author

rob4629 commented Feb 28, 2020

Hi @AlexSkorkin, can you provide me with the command you're using?

Myself and my colleagues are experiencing the re-sizing behaviour when using the below command... and haven't been able to resolve it:

testcafe 'chrome:emulation:device=iphone X'

TestCafe Mobile Screen Recording.mov.zip

@no-response no-response bot removed the STATE: Need clarification An issue lacks information for further research. label Feb 28, 2020
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Feb 28, 2020
@AlexSkorkin
Copy link
Collaborator

I used both of these commands, but I couldn't replicate this behavior:

testcafe 'chrome:emulation:device=iphone X'
testcafe 'chrome:emulation:device=iphone X' --debug-on-fail

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Mar 2, 2020
@AlexSkorkin AlexSkorkin added the STATE: Need clarification An issue lacks information for further research. label Mar 2, 2020
@rob4629
Copy link
Contributor Author

rob4629 commented Mar 2, 2020

Would the version of Node make a difference? I'm using the latest Chrome version, on Catalina OS.

I can't think of any other reason for the difference in behaviour... and would be reluctant to close this issue due to "It works on my machine".

@no-response no-response bot removed the STATE: Need clarification An issue lacks information for further research. label Mar 2, 2020
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Mar 2, 2020
@AlexanderMoiseev
Copy link
Contributor

We tried to run your test on several different machines with a similar configuration, including the node.js version 10.15.3, but our attempts to replicate the issue were unsuccessful. Right now, we are out of any ideas on why this issue occurs and how to reproduce it on our side.

@AlexanderMoiseev AlexanderMoiseev removed the STATE: Need response An issue that requires a response or attention from the team. label Mar 4, 2020
@AlexSkorkin AlexSkorkin added the STATE: Need clarification An issue lacks information for further research. label Mar 5, 2020
@no-response
Copy link

no-response bot commented Mar 15, 2020

This issue was automatically closed because there was no response to our request for more information from the original author. Currently, we don't have enough information to take action. Please reach out to us if you find the necessary information and are able to share it. We are also eager to know if you resolved the issue on your own and can share your findings with everyone.

@no-response no-response bot closed this as completed Mar 15, 2020
@ajadhav
Copy link

ajadhav commented Jul 10, 2023

Would the version of Node make a difference? I'm using the latest Chrome version, on Catalina OS.

I can't think of any other reason for the difference in behaviour... and would be reluctant to close this issue due to "It works on my machine".

Hey Rob, were you able to find a fix for this behavior? I'm seeing something similar but the resize only happens a few time after page load and then goes away but it is enough to cause testcafe retry/reload of the page and results in some unstable tests.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jul 10, 2023
@AlexKamaev AlexKamaev removed the STATE: Need response An issue that requires a response or attention from the team. label Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATE: Need clarification An issue lacks information for further research.
Projects
None yet
Development

No branches or pull requests

9 participants