Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
479 views
in Technique[技术] by (71.8m points)

testing - On testcafe select chrome as browser and in middle of test change to emulate device to change into device view

Hello I want use chrome to run my testcase on testcafe and after test some testcase I want change it into Emulate a Device, lets say I want change it into device Iphone X, Is it possible to change it in the middle of test? thanks

question from:https://stackoverflow.com/questions/65879557/on-testcafe-select-chrome-as-browser-and-in-middle-of-test-change-to-emulate-dev

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If you want to emulate window size and portrait/landscape orientation only, you can use the resizeWindowToFitDevice method. See the following article: https://devexpress.github.io/testcafe/documentation/reference/test-api/testcontroller/resizewindowtofitdevice.html

However, if you need to emulate User Agent or touch device, you can do it only when TestCafe starts. See the following article for more details: https://devexpress.github.io/testcafe/documentation/guides/concepts/browsers.html#use-chromium-device-emulation


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...