-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
153 additions
and
52 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { SettingsGeneralSelectors } from 'src/app/templates/SettingsGeneral/selectors'; | ||
|
||
import { Page } from '../../classes/page.class'; | ||
import { createPageElement } from '../../utils/search.utils'; | ||
|
||
export class GeneralSettingsPage extends Page { | ||
languageitem = createPageElement(SettingsGeneralSelectors.languageitem); | ||
languageDropDown = createPageElement(SettingsGeneralSelectors.languageDropDown); | ||
currencyItem = createPageElement(SettingsGeneralSelectors.currencyItem); | ||
currenctyDropDown = createPageElement(SettingsGeneralSelectors.currenctyDropDown); | ||
blockExplorerItem = createPageElement(SettingsGeneralSelectors.blockExplorerItem); | ||
blockExplorerDropDown = createPageElement(SettingsGeneralSelectors.blockExplorerDropDown); | ||
popUpCheckBox = createPageElement(SettingsGeneralSelectors.popUpCheckBox); | ||
extensionLockUpCheckBox = createPageElement(SettingsGeneralSelectors.extensionLockUpCheckBox); | ||
anonymousAnalyticsCheckBox = createPageElement(SettingsGeneralSelectors.anonymousAnalyticsCheckBox); | ||
notificationCheckBox = createPageElement(SettingsGeneralSelectors.notificationCheckBox); | ||
partnersPromotion = createPageElement(SettingsGeneralSelectors.partnersPromotion); | ||
|
||
async isVisible() { | ||
await this.languageDropDown.waitForDisplayed(); | ||
await this.currenctyDropDown.waitForDisplayed(); | ||
await this.blockExplorerDropDown.waitForDisplayed(); | ||
await this.popUpCheckBox.waitForDisplayed(); | ||
await this.extensionLockUpCheckBox.waitForDisplayed(); | ||
await this.anonymousAnalyticsCheckBox.waitForDisplayed(); | ||
await this.notificationCheckBox.waitForDisplayed(); | ||
await this.partnersPromotion.waitForDisplayed(); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,63 @@ | ||
import { Given } from '@cucumber/cucumber'; | ||
import axios from 'axios'; | ||
|
||
import { envVars } from 'e2e/src/utils/env.utils'; | ||
import { MEDIUM_TIMEOUT } from 'e2e/src/utils/timing.utils'; | ||
|
||
import { Pages } from '../page-objects'; | ||
|
||
Given( | ||
/I check that a notification with (.*) title and (.*) description is not displayed/, | ||
/I check that a notification with '(.*)' title and '(.*)' description is displayed/, | ||
{ timeout: MEDIUM_TIMEOUT }, | ||
async (title: string, shortDescription: string) => { | ||
await Pages.NotificationsList.isNotificationDisplayed(title, shortDescription); | ||
} | ||
); | ||
|
||
Given( | ||
/I check that a notification with '(.*)' title and '(.*)' description is NOT displayed/, | ||
{ timeout: MEDIUM_TIMEOUT }, | ||
async (title: string, shortDescription: string) => { | ||
await Pages.NotificationsList.isNotificationNotDisplayed(title, shortDescription); | ||
} | ||
); | ||
|
||
Given( | ||
/I click on the notification with '(.*)' title and '(.*)' description/, | ||
{ timeout: MEDIUM_TIMEOUT }, | ||
async (title: string, shortDescription: string) => { | ||
await Pages.NotificationsList.clickOnTheNotification(title, shortDescription); | ||
} | ||
); | ||
|
||
Given(/I make request for creating a notification/, { timeout: MEDIUM_TIMEOUT }, async () => { | ||
const currentDate = new Date(); | ||
const currentDateISO = new Date().toISOString(); | ||
const expirationDateISO = new Date(currentDate.getTime() + 60000).toISOString(); // Notification will be deleted in 4 minutes | ||
|
||
const requestBody = { | ||
mobile: 'off', | ||
extension: 'on', | ||
type: 'News', | ||
title: 'Test Title', | ||
description: 'Test description', | ||
extensionImageUrl: | ||
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRtIvsRFAUjlUKqlsLnrrJnWtcx98vOncHTXQ&usqp=CAU', | ||
mobileImageUrl: '', | ||
content: 'Test content', | ||
date: currentDateISO, | ||
expirationDate: expirationDateISO | ||
}; | ||
|
||
const response = await axios.post('https://temple-api-mainnet.stage.madfish.xyz/api/notifications', requestBody, { | ||
headers: { | ||
'Content-Type': 'application/json', | ||
Authorization: envVars.NOTIFICATION_AUTHORIZATION | ||
} | ||
}); | ||
|
||
if (response.status !== 200) | ||
throw new Error( | ||
`Some problems with backend server. Server returns ${response.statusText} with ${response.status} status code` | ||
); | ||
}); |
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