-
-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/dockerfile_missing_tsc
- Loading branch information
Showing
40 changed files
with
1,071 additions
and
644 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 +1,2 @@ | ||
REACT_DAPP_URL= | ||
TEST_DAPP_URL= |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import { | ||
WDIO_ACCESSIBILITY_ID, | ||
WDIO_ANDROID_UI_AUTOMATOR, | ||
WDIO_IOS_PREDICATE_STRING, | ||
WDIO_RESOURCE_ID, | ||
WDIO_XPATH, | ||
} from './Constants'; | ||
|
||
class WDIOSelector { | ||
/* | ||
* Returns the locator for the given accessibilityId | ||
* @param accessibilityId: string | ||
* */ | ||
accessibilityId(accessibilityId: string): string { | ||
return `${WDIO_ACCESSIBILITY_ID}${accessibilityId}`; | ||
} | ||
|
||
/* | ||
* Returns the locator for the given xpath | ||
* @param xpath: string | ||
* */ | ||
xpath(xpath: string): string { | ||
// Even though webdriver.io xpath selector is an empty string, it may change at any point | ||
return `${WDIO_XPATH}${xpath}`; | ||
} | ||
|
||
/* | ||
* Returns the locator for the given resource-id | ||
* @param resourceId: string | ||
* */ | ||
resourceId(resourceId: string): string { | ||
return `${WDIO_RESOURCE_ID}${resourceId}`; | ||
} | ||
} | ||
|
||
export class AndroidSelector extends WDIOSelector { | ||
private readonly uiAutomatorPredicate = 'new UiSelector()'; | ||
|
||
private uiAutomatorSelector = ''; | ||
|
||
constructor() { | ||
super(); | ||
this.uiAutomatorSelector = `${WDIO_ANDROID_UI_AUTOMATOR}${this.uiAutomatorPredicate}`; | ||
} | ||
|
||
uiAutomatorAndText(text: string): string { | ||
return this.uiAutomatorSelector.concat(`.text("${text}")`); | ||
} | ||
|
||
uiAutomatorAndClassName(className: string): string { | ||
return this.uiAutomatorSelector.concat(`.className("${className}")`); | ||
} | ||
|
||
uiAutomatorAndDescription(description: string): string { | ||
return this.uiAutomatorSelector.concat(`.description("${description}")`); | ||
} | ||
|
||
static by() { | ||
return new AndroidSelector(); | ||
} | ||
} | ||
|
||
export class IOSSelector extends WDIOSelector { | ||
private predicateStringSelector = ''; | ||
|
||
constructor() { | ||
super(); | ||
this.predicateStringSelector = `${WDIO_IOS_PREDICATE_STRING}`; | ||
} | ||
|
||
predicateString(predicateString: string): string { | ||
return this.predicateStringSelector.concat(predicateString); | ||
} | ||
|
||
iosClassChain(classChain: string): string { | ||
return this.predicateStringSelector.concat(classChain); | ||
} | ||
|
||
static by() { | ||
return new IOSSelector(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
118 changes: 118 additions & 0 deletions
118
e2e/src/screens/Android/AndroidSettingsOpeningLinksScreen.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,118 @@ | ||
import { ChainablePromiseElement } from 'webdriverio'; | ||
import { METAMASK_APP_NAME_ANDROID } from '../../Constants'; | ||
import Gestures from '../../Gestures'; | ||
import { getSelectorForPlatform } from '../../Utils'; | ||
import { AndroidSelector } from '../../Selectors'; | ||
|
||
class AndroidSettingsOpeningLinksScreen { | ||
get openingLinksMetaMaskAppOption(): ChainablePromiseElement<WebdriverIO.Element> { | ||
return $( | ||
getSelectorForPlatform({ | ||
androidSelector: AndroidSelector.by().xpath( | ||
`//android.widget.TextView[@resource-id="android:id/title" and @text="${METAMASK_APP_NAME_ANDROID}"]`, | ||
), | ||
}), | ||
); | ||
} | ||
|
||
get addLinksButton(): ChainablePromiseElement<WebdriverIO.Element> { | ||
return $( | ||
getSelectorForPlatform({ | ||
androidSelector: AndroidSelector.by().xpath( | ||
'//*[@resource-id="android:id/title" and @text="Add link"]', | ||
), | ||
}), | ||
); | ||
} | ||
|
||
get addSupportedLinksButton(): ChainablePromiseElement<WebdriverIO.Element> { | ||
return $( | ||
getSelectorForPlatform({ | ||
androidSelector: AndroidSelector.by().xpath( | ||
'//android.widget.Button[@resource-id="android:id/button1"]', | ||
), | ||
}), | ||
); | ||
} | ||
|
||
get firstSupportedLink(): ChainablePromiseElement<WebdriverIO.Element> { | ||
return $( | ||
getSelectorForPlatform({ | ||
androidSelector: AndroidSelector.by().xpath( | ||
'//*[@resource-id="android:id/text1" and @text="metamask-alternate.app.link"]', | ||
), | ||
}), | ||
); | ||
} | ||
|
||
get secondSupportedLink(): ChainablePromiseElement<WebdriverIO.Element> { | ||
return $( | ||
getSelectorForPlatform({ | ||
androidSelector: AndroidSelector.by().xpath( | ||
'//*[@resource-id="android:id/text1" and @text="metamask-alternate.test-app.link"]', | ||
), | ||
}), | ||
); | ||
} | ||
|
||
get thirdSupportedLink(): ChainablePromiseElement<WebdriverIO.Element> { | ||
return $( | ||
getSelectorForPlatform({ | ||
androidSelector: AndroidSelector.by().xpath( | ||
'//*[@resource-id="android:id/text1" and @text="metamask.test-app.link"]', | ||
), | ||
}), | ||
); | ||
} | ||
|
||
get forthSupportedLink(): ChainablePromiseElement<WebdriverIO.Element> { | ||
return $( | ||
getSelectorForPlatform({ | ||
androidSelector: AndroidSelector.by().xpath( | ||
'//*[@resource-id="android:id/text1" and @text="metamask.app.link"]', | ||
), | ||
}), | ||
); | ||
} | ||
|
||
async scrollToMetaMaskAppOption(): Promise<void> { | ||
let isMetaMaskLinksButtonDisplayed = await ( | ||
await this.openingLinksMetaMaskAppOption | ||
).isDisplayed(); | ||
|
||
while (!isMetaMaskLinksButtonDisplayed) { | ||
await Gestures.swipeByPercentage({ x: 50, y: 90 }, { x: 50, y: 5 }); | ||
isMetaMaskLinksButtonDisplayed = await ( | ||
await this.openingLinksMetaMaskAppOption | ||
).isDisplayed(); | ||
} | ||
} | ||
|
||
async tapMetaMaskAppOption(): Promise<void> { | ||
await (await this.openingLinksMetaMaskAppOption).click(); | ||
} | ||
|
||
async selectAllMetaMaskSupportedLinks(): Promise<void> { | ||
await (await this.firstSupportedLink).click(); | ||
await (await this.secondSupportedLink).click(); | ||
await (await this.thirdSupportedLink).click(); | ||
await (await this.forthSupportedLink).click(); | ||
} | ||
|
||
async tapAddMetaMaskSupportedLinks(): Promise<void> { | ||
await (await this.addSupportedLinksButton).click(); | ||
} | ||
|
||
async tapAddLinksButton(): Promise<void> { | ||
await (await this.addLinksButton).click(); | ||
} | ||
|
||
async isAddLinksButtonEnabled(): Promise<boolean> { | ||
return await (await this.addLinksButton).isEnabled(); | ||
} | ||
} | ||
|
||
const androidSettingsOpeningLinksScreen = | ||
new AndroidSettingsOpeningLinksScreen(); | ||
|
||
export default androidSettingsOpeningLinksScreen; |
Oops, something went wrong.