forked from wahello/peerio-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP: add cucumber tests (visit help centre, send logs) for help page * chore: prettier * WIP: add test code for scenarios visit help centre, send logs, on mobile help page * WIP: add scenarios to mobile help page tests * WIP: minor changes (code refactor) in help.feature * WIP: updated test for visit helpcenter to check for correct url in browser on Android * chore: introduce android specific test for help * WIP: refactored code for Android-specific checkIfWebsiteHasOpened() * chore: uncommented scenarios in help.feature
- Loading branch information
Showing
10 changed files
with
107 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,28 @@ | ||
const { android } = require('../platforms'); | ||
const ChatActionSheetPage = require('../pages/popups/actionSheetPage/AndroidChatActionSheetPage'); | ||
const FileUploadPage = require('../pages/files/fileUploadPage/AndroidFileUploadPage'); | ||
const AndroidSettingsPage = require('../pages/settings/AndroidSettingsPage'); | ||
|
||
class AndroidFactory { | ||
get bundleId() { | ||
return 'com.peerio.app'; | ||
} | ||
|
||
get platform() { | ||
return android; | ||
} | ||
|
||
chatActionSheetPage(app) { | ||
return new ChatActionSheetPage(app); | ||
} | ||
|
||
fileUploadPage(app) { | ||
return new FileUploadPage(app); | ||
} | ||
|
||
settingsPage(app) { | ||
return new AndroidSettingsPage(app); | ||
} | ||
} | ||
|
||
module.exports = new AndroidFactory(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,28 @@ | ||
const { iOS } = require('../platforms'); | ||
const ChatActionSheetPage = require('../pages/popups/actionSheetPage/iOSChatActionSheetPage'); | ||
const FileUploadPage = require('../pages/files/fileUploadPage/iOSFileUploadPage'); | ||
const IosSettingsPage = require('../pages/settings/IosSettingsPage'); | ||
|
||
class iOSFactory { | ||
get bundleId() { | ||
return 'com.peerio'; | ||
} | ||
|
||
get platform() { | ||
return iOS; | ||
} | ||
|
||
chatActionSheetPage(app) { | ||
return new ChatActionSheetPage(app); | ||
} | ||
|
||
fileUploadPage(app) { | ||
return new FileUploadPage(app); | ||
} | ||
|
||
settingsPage(app) { | ||
return new IosSettingsPage(app); | ||
} | ||
} | ||
|
||
module.exports = new iOSFactory(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const SettingsPage = require('./settingsPage'); | ||
|
||
const { selectorWithPartialText } = require('../../helpers/androidHelper'); | ||
|
||
class AndroidSettingsPage extends SettingsPage { | ||
checkIfWebsiteHasOpened() { | ||
const myUrl = selectorWithPartialText('support.peerio.com'); | ||
return this.getWhenVisible(myUrl); | ||
} | ||
} | ||
|
||
module.exports = AndroidSettingsPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const SettingsPage = require('./settingsPage'); | ||
|
||
class IosSettingsPage extends SettingsPage { | ||
checkIfWebsiteHasOpened() { | ||
console.log('Stub'); | ||
return true; | ||
} | ||
} | ||
|
||
module.exports = IosSettingsPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const { When, Then } = require('cucumber'); | ||
|
||
When('I go to help settings', async function() { | ||
await this.homePage.settingsTab.click(); | ||
await this.settingsPage.helpButton.click(); | ||
}); | ||
|
||
When('I tap Chat button in help settings', async function() { | ||
await this.settingsPage.chatButton.click(); | ||
}); | ||
|
||
When('I tap Send button in help settings', async function() { | ||
await this.settingsPage.sendButton.click(); | ||
}); | ||
|
||
When('an e-mail opens in the native e-mail app', async function() { | ||
// TODO: native e-mail check | ||
return 'pending'; | ||
}); | ||
|
||
When('I tap Visit button in help settings', async function() { | ||
await this.settingsPage.visitButton.click(); | ||
}); | ||
|
||
Then('the Peerio Zendesk opens in browser', async function() { | ||
// should throw if not found for android | ||
// should just continue on iOS | ||
await this.settingsPage.checkIfWebsiteHasOpened(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters