Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48981

How to test for different platforms on Ionic/Angular using Cypress?

$
0
0

Throughout my app I’m using Platform from @ionic/angular to determine whether they’re a mobile device, tablet, etc and displaying certain UI specifically for those devices. Now with Cypress it’s easy to change viewport width to test for varying screen sizes, but I haven’t figured out how to mock the Platform from @ionic/angular to tell it to change devices. On Cypress all the tests are run in a web browser, so by default it will tell the Platform API that it’s a desktop web browser.

Anyone else have experience testing Ionic using Cypress? How can I mock the Platform API from @ionic/angular to have Cypress run as a mobile or tablet platform?

Thanks

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 48981

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>