Skip to content

Commit

Permalink
Try with beforeHook
Browse files Browse the repository at this point in the history
  • Loading branch information
Maria Lorena Rodriguez Viruel authored and Maria Lorena Rodriguez Viruel committed Jan 12, 2024
1 parent 58874dc commit 5f08fa7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/e2e/default-mobile/wdio.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ exports.config = Object.assign(wdioBaseConfig.config, {
],
]
},
beforeSuite: async () => {
beforeHook: async () => {
// We tried the browser.emulateDevice('...') function but it's not stable enough,
// it looses the mobile view and switches back to desktop.
// Adding to the comment above, it loses the mobile view when a test fails.
// It may be better to use beforeHook instead of beforeSuite so it can set the capability before each test.
console.log('default-mobile beforeHook code');
await browser.emulateDevice({
viewport: {
width: 600,
Expand Down

0 comments on commit 5f08fa7

Please sign in to comment.