-
Notifications
You must be signed in to change notification settings - Fork 0
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
WALLET-412: Run UI-based tests in CI #20
Changes from all commits
6122be6
e32694c
6def162
c1b2817
139758a
663fb32
d5ad5fd
1169140
859b52a
73712d8
bb7c8aa
f2702e6
330cfaf
c8d00fb
d246f71
d25d1b9
00f04e8
6316133
916f3ad
5afcf54
49109c7
2e08be6
a0a990e
ae0a285
32d4335
c9bd891
194c5c2
3ff668b
6c76bb7
03d8ddd
e235929
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,4 +41,4 @@ jobs: | |
uses: kitabisa/[email protected] | ||
with: | ||
host: ${{ secrets.SONARQUBE_HOST }} | ||
login: ${{ secrets.SONARQUBE_DEV_INRUPT_COM_GITHUB_TOKEN }} | ||
login: ${{ secrets.SONARQUBE_DEV_INRUPT_COM_GITHUB_TOKEN }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,6 @@ expo-env.d.ts | |
.env | ||
|
||
*.keystore | ||
|
||
# Folder where the UI tests get stored. | ||
screenshots/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
// | ||
import { by, element, expect, web } from "detox"; | ||
|
||
import detoxConfig from "../../.detoxrc"; | ||
import HomePage from "./HomePage"; | ||
import PermissionPage from "./PermissionPage"; | ||
|
@@ -58,20 +59,18 @@ class LoginPage { | |
|
||
// Perform login | ||
await expect(this.signInFormUsernameInput).toExist(); | ||
await this.signInFormUsernameInput.runScript(`(element) => { | ||
element.value = "${username}"; | ||
}`); | ||
await this.signInFormUsernameInput.replaceText(username); | ||
|
||
await expect(this.signInFormPasswordInput).toExist(); | ||
await this.signInFormPasswordInput.runScript(`(element) => { | ||
element.value = "${password}"; | ||
}`); | ||
await this.signInFormPasswordInput.replaceText(password); | ||
|
||
await expect(this.signInSubmitButton).toExist(); | ||
await this.signInSubmitButton.runScript((buttonElement) => { | ||
buttonElement.click(); | ||
await new Promise((resolve) => { | ||
setTimeout(resolve, timeout * 5); | ||
}); | ||
|
||
await expect(this.signInSubmitButton).toExist(); | ||
await this.signInSubmitButton.tap(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto using a more expressive API for the given task. |
||
|
||
// Handle permission screen | ||
await new Promise((resolve) => { | ||
setTimeout(resolve, timeout); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,20 +18,21 @@ | |
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
// | ||
|
||
import { expect, web, by } from "detox"; | ||
|
||
class PermissionPage { | ||
private continueButton: Detox.WebElement; | ||
|
||
constructor() { | ||
this.continueButton = web.element( | ||
by.web.xpath('//button[text()="Continue"]') | ||
by.web.cssSelector('button[data-testid="prompt-continue"]') | ||
Comment on lines
-26
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using |
||
); | ||
} | ||
|
||
async clickContinueButton() { | ||
// await waitFor(this.continueButton).toExist().withTimeout(5000); | ||
await this.continueButton.runScript((element: HTMLButtonElement) => { | ||
element.click(); | ||
}); | ||
await expect(this.continueButton).toExist(); | ||
await this.continueButton.tap(); | ||
} | ||
} | ||
|
||
|
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.
This feels like a more readable approach, using a more appropriate API for the task.