-
Notifications
You must be signed in to change notification settings - Fork 3
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
QA - New: Notification setting tests and getting ready for notification service testing #1900
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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
83 changes: 83 additions & 0 deletions
83
packages/core-mobile/e2e/pages/burgerMenu/notifications.page.ts
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,83 @@ | ||
import actions from '../../helpers/actions' | ||
import commonElsPage from '../commonEls.page' | ||
import burgerMenuPage from './burgerMenu.page' | ||
|
||
class Notifications { | ||
get stakeEnabledSwitch() { | ||
return by.id('Stake_enabled_switch') | ||
} | ||
|
||
get stakeDisabledSwitch() { | ||
return by.id('Stake_disabled_switch') | ||
} | ||
|
||
get balanceEnabledSwitch() { | ||
return by.id('Balance_enabled_switch') | ||
} | ||
|
||
get balanceDisabledSwitch() { | ||
return by.id('Balance_disabled_switch') | ||
} | ||
|
||
async tapStakeSwitch(on = true) { | ||
if (on) { | ||
await actions.tap(this.stakeDisabledSwitch) | ||
} else { | ||
await actions.tap(this.stakeEnabledSwitch) | ||
} | ||
} | ||
|
||
async tapBalanceSwitch(on = true) { | ||
if (on) { | ||
await actions.tap(this.balanceDisabledSwitch) | ||
} else { | ||
await actions.tap(this.balanceEnabledSwitch) | ||
} | ||
} | ||
|
||
async switchBalanceNotification(on = true) { | ||
await burgerMenuPage.tapBurgerMenuButton() | ||
await burgerMenuPage.tapNotifications() | ||
await this.tapBalanceSwitch(on) | ||
await commonElsPage.tapBackButton() | ||
await burgerMenuPage.dismissBurgerMenu() | ||
} | ||
|
||
async verifyNotificationsSwitches(stake: boolean, balance: boolean) { | ||
if (stake && balance) { | ||
// both switches are ON | ||
await actions.waitForElement(this.stakeEnabledSwitch) | ||
await actions.waitForElement(this.balanceEnabledSwitch) | ||
} else if (stake && !balance) { | ||
// only stake switch is ON | ||
await actions.waitForElement(this.stakeEnabledSwitch) | ||
await actions.waitForElement(this.balanceDisabledSwitch) | ||
} else if (!stake && balance) { | ||
// only balance switch is ON | ||
await actions.waitForElement(this.stakeDisabledSwitch) | ||
await actions.waitForElement(this.balanceEnabledSwitch) | ||
} else if (!stake && !balance) { | ||
// both switches are OFF | ||
await actions.waitForElement(this.stakeDisabledSwitch) | ||
await actions.waitForElement(this.balanceDisabledSwitch) | ||
} | ||
} | ||
|
||
async verifyPushNotification() { | ||
// TODO: currently push notification is broken on internal build. We can update the methods once it's fixed | ||
console.log('verify push notification is received') | ||
} | ||
|
||
async tapPushNotification() { | ||
// TODO: currently push notification is broken on internal build. We can update the methods once it's fixed | ||
console.log('verify the deeplink works properly') | ||
await device.launchApp() // temporary solution | ||
} | ||
|
||
async verifyNoPushNotification() { | ||
// TODO: currently push notification is broken on internal build. We can update the methods once it's fixed | ||
console.log('verify the push notification is NOT received') | ||
} | ||
} | ||
|
||
export default new Notifications() |
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
36 changes: 36 additions & 0 deletions
36
packages/core-mobile/e2e/tests/notification/sendNotification.e2e.ts
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,36 @@ | ||
import { warmup } from '../../helpers/warmup' | ||
import sendLoc from '../../locators/send.loc' | ||
import accountManagePage from '../../pages/accountManage.page' | ||
import notificationsPage from '../../pages/burgerMenu/notifications.page' | ||
import portfolioPage from '../../pages/portfolio.page' | ||
import sendPage from '../../pages/send.page' | ||
|
||
describe('Send Notification', () => { | ||
beforeAll(async () => { | ||
await warmup(false, true) | ||
await accountManagePage.createSecondAccount() | ||
}) | ||
|
||
it('should receive send notification', async () => { | ||
await sendPage.sendTokenTo2ndAccount( | ||
sendLoc.avaxToken, | ||
sendLoc.sendingAmount | ||
) | ||
await device.sendToHome() | ||
await notificationsPage.verifyPushNotification() | ||
await notificationsPage.tapPushNotification() | ||
await portfolioPage.verifyPorfolioScreen() | ||
}) | ||
|
||
it('should not receive send notification', async () => { | ||
await notificationsPage.switchBalanceNotification(false) | ||
await sendPage.sendTokenTo2ndAccount( | ||
sendLoc.avaxToken, | ||
sendLoc.sendingAmount | ||
) | ||
await device.sendToHome() | ||
await notificationsPage.verifyNoPushNotification() | ||
await device.launchApp() | ||
await portfolioPage.verifyPorfolioScreen() | ||
}) | ||
}) |
44 changes: 44 additions & 0 deletions
44
packages/core-mobile/e2e/tests/settings/notification.e2e.smoke.ts
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,44 @@ | ||
import { warmup } from '../../helpers/warmup' | ||
import burgerMenuPage from '../../pages/burgerMenu/burgerMenu.page' | ||
import notificationsPage from '../../pages/burgerMenu/notifications.page' | ||
import commonElsPage from '../../pages/commonEls.page' | ||
|
||
describe('Notification setting', () => { | ||
it('should turn on balance notification when log in', async () => { | ||
await warmup(false, true) | ||
await burgerMenuPage.tapBurgerMenuButton() | ||
await burgerMenuPage.tapNotifications() | ||
await notificationsPage.verifyNotificationsSwitches(false, true) | ||
await commonElsPage.tapBackButton() | ||
await burgerMenuPage.deleteWallet() | ||
}) | ||
|
||
it('should turn off balance notification when log in', async () => { | ||
await warmup() | ||
await burgerMenuPage.tapBurgerMenuButton() | ||
await burgerMenuPage.tapNotifications() | ||
await notificationsPage.verifyNotificationsSwitches(false, false) | ||
}) | ||
it('should turn on all notifications', async () => { | ||
await notificationsPage.tapStakeSwitch() | ||
await notificationsPage.verifyNotificationsSwitches(true, false) | ||
await commonElsPage.tapBackButton() | ||
await burgerMenuPage.tapNotifications() | ||
await notificationsPage.tapBalanceSwitch() | ||
await notificationsPage.verifyNotificationsSwitches(true, true) | ||
await commonElsPage.tapBackButton() | ||
await burgerMenuPage.tapNotifications() | ||
await notificationsPage.verifyNotificationsSwitches(true, true) | ||
}) | ||
it('should turn off all notifications', async () => { | ||
await notificationsPage.tapStakeSwitch(false) | ||
await notificationsPage.verifyNotificationsSwitches(false, true) | ||
await commonElsPage.tapBackButton() | ||
await burgerMenuPage.tapNotifications() | ||
await notificationsPage.tapBalanceSwitch(false) | ||
await notificationsPage.verifyNotificationsSwitches(false, false) | ||
await commonElsPage.tapBackButton() | ||
await burgerMenuPage.tapNotifications() | ||
await notificationsPage.verifyNotificationsSwitches(false, false) | ||
}) | ||
}) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The push notification is broken currently. I added a file and folder as a placeholder and a reminder for future work. I marked the test to be ignored in config files.