Skip to content

Commit 425f2e3

Browse files
feat: add e2e for device locales
1 parent 5cbe049 commit 425f2e3

24 files changed

+245
-1
lines changed

e2e/update_samples

+2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ fi
1717

1818
rm -rf samples/ samples.zip
1919
mkdir -p samples/
20+
mkdir -p samples/wikipedia_es_ES
2021
cp -r apps/wikipedia.apk apps/wikipedia.zip samples/
2122
cp -r workspaces/wikipedia/* samples/
23+
cp -r workspaces/wikipedia_es_ES/* samples/wikipedia_es_ES
2224
cp samples/wikipedia.apk samples/sample.apk # The name is being depended upon.
2325
cp samples/wikipedia.zip samples/sample.zip # The name is being depended upon.
2426
cd samples/

e2e/workspaces/wikipedia/subflows/onboarding-ios.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ appId: org.wikimedia.wikipedia
99
direction: LEFT
1010
duration: 400
1111
- waitForAnimationToEnd
12-
- tapOn: Get started
12+
- tapOn: Empezar
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
appId: org.wikipedia
2+
tags:
3+
- android
4+
- passing
5+
- advanced
6+
---
7+
- runFlow: subflows/onboarding-android.yaml
8+
- tapOn:
9+
id: "org.wikipedia:id/search_container"
10+
- runScript: scripts/getSearchQuery.js
11+
- inputText: ${output.result}
12+
- assertVisible: ${output.result}
13+
- runFlow: subflows/launch-clearstate-android.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
appId: org.wikipedia
2+
tags:
3+
- android
4+
- passing
5+
---
6+
- launchApp
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
appId: org.wikimedia.wikipedia
2+
tags:
3+
- ios
4+
- passing
5+
- advanced
6+
---
7+
- runFlow: subflows/onboarding-ios.yaml
8+
9+
# Dismiss the auth modal if visible
10+
- runFlow:
11+
when:
12+
visible: "You have been logged out"
13+
commands:
14+
- tapOn:
15+
text: "Continue without logging in"
16+
17+
- tapOn: Buscar en Wikipedia
18+
- runScript: scripts/getSearchQuery.js
19+
- inputText: ${output.result}
20+
- eraseText
21+
- inputText: qwerty
22+
- assertVisible: ${output.result}
23+
- runFlow: subflows/launch-clearstate-ios.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
appId: org.wikimedia.wikipedia
2+
tags:
3+
- ios
4+
- passing
5+
---
6+
- launchApp
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
output.result = 'qwerty';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
appId: org.wikipedia
2+
---
3+
- launchApp:
4+
clearState: true
5+
- assertVisible: "Saltar"
6+
- assertVisible: "CONTINUAR"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
appId: org.wikimedia.wikipedia
2+
---
3+
- launchApp:
4+
clearState: true
5+
- assertVisible: "Siguiente"
6+
- assertVisible: "Omitir"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
appId: org.wikipedia
2+
---
3+
- launchApp:
4+
clearState: true
5+
- tapOn:
6+
id: "org.wikipedia:id/fragment_onboarding_forward_button"
7+
- tapOn:
8+
id: "org.wikipedia:id/fragment_onboarding_forward_button"
9+
- tapOn:
10+
id: "org.wikipedia:id/fragment_onboarding_forward_button"
11+
- tapOn:
12+
id: "org.wikipedia:id/fragment_onboarding_done_button"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
appId: org.wikimedia.wikipedia
2+
---
3+
- launchApp:
4+
clearState: true
5+
- repeat:
6+
times: 3
7+
commands:
8+
- swipe:
9+
direction: LEFT
10+
duration: 400
11+
- waitForAnimationToEnd
12+
- tapOn: Empezar
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
appId: org.wikipedia
2+
---
3+
- tapOn: "More"
4+
- tapOn: "LOG IN.*"
5+
- tapOn:
6+
id: ".*create_account_login_button"
7+
- runScript: "../scripts/fetchTestUser.js"
8+
- tapOn: "Username"
9+
- inputText: "${output.test_user.username}"
10+
- tapOn: "Password"
11+
- inputText: "No provided"
12+
- tapOn: "LOG IN"
13+
- back
14+
- back
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
appId: org.wikipedia
2+
---
3+
- tapOn: "More"
4+
- tapOn: "LOG IN.*"
5+
- runScript: "../scripts/generateCredentials.js"
6+
- tapOn: "Username"
7+
- inputText: "${output.credentials.username}"
8+
- tapOn: "Password"
9+
- inputText: "${output.credentials.password}"
10+
- tapOn: "Repeat password"
11+
- inputText: "${output.credentials.password}"
12+
- tapOn: "Email.*"
13+
- inputText: "${output.credentials.email}"
14+
15+
# We won't actually create the account
16+
- back
17+
- back
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
appId: org.wikipedia
2+
---
3+
- tapOn: "Explore"
4+
- scrollUntilVisible:
5+
element: "Top read"
6+
- copyTextFrom:
7+
id: ".*view_list_card_item_title"
8+
index: 0
9+
- tapOn: "Explore"
10+
- tapOn: "Search Wikipedia"
11+
- inputText: "${maestro.copiedText}"
12+
- back
13+
- back
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
appId: org.wikipedia
2+
---
3+
- tapOn: "Explore"
4+
- scrollUntilVisible:
5+
element: "Today on Wikipedia.*"
6+
- tapOn: "Today on Wikipedia.*"
7+
- back
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
appId: org.wikipedia
2+
---
3+
- runFlow: "search.yml"
4+
- runFlow: "saved.yml"
5+
- runFlow: "feed.yml"
6+
- runFlow: "copy-paste.yml"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
appId: org.wikipedia
2+
---
3+
- tapOn: "Saved"
4+
- tapOn: "Default list for your saved articles"
5+
- assertVisible: "Sun"
6+
- assertVisible: "Star at the center of the Solar System"
7+
- back
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
appId: org.wikipedia
2+
---
3+
- tapOn: "Search Wikipedia"
4+
- inputText: "Sun"
5+
- assertVisible: "Star at the center of the Solar System"
6+
- tapOn:
7+
id: ".*page_list_item_title"
8+
- tapOn:
9+
id: ".*page_save"
10+
- back
11+
- back
12+
- back
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
appId: org.wikipedia
2+
---
3+
- tapOn: "ADD OR EDIT.*"
4+
- tapOn: "ADD LANGUAGE"
5+
- tapOn:
6+
id: ".*menu_search_language"
7+
- inputText: "Greek"
8+
- assertVisible: "Ελληνικά"
9+
- tapOn: "Ελληνικά"
10+
- tapOn: "Navigate up"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
appId: org.wikipedia
2+
---
3+
- runFlow: "add-language.yml"
4+
- runFlow: "remove-language.yml"
5+
- tapOn: "Continue"
6+
- assertVisible: "New ways to explore"
7+
- tapOn: "Continue"
8+
- assertVisible: "Reading lists with sync"
9+
- tapOn: "Continue"
10+
- assertVisible: "Send anonymous data"
11+
- tapOn: "Get started"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
appId: org.wikipedia
2+
---
3+
- tapOn: "ADD OR EDIT.*"
4+
- tapOn: "More options"
5+
- tapOn: "Remove language"
6+
- tapOn:
7+
id: ".*wiki_language_checkbox"
8+
index: 1
9+
- tapOn:
10+
id: ".*menu_delete_selected"
11+
- tapOn: "OK"
12+
- assertNotVisible: "Ελληνικά"
13+
- tapOn: "Navigate up"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
appId: org.wikipedia
2+
tags:
3+
- android
4+
- passing
5+
---
6+
- launchApp:
7+
clearState: true
8+
- runFlow: "onboarding/main.yml"
9+
- runFlow: "dashboard/main.yml"
10+
- runFlow: "auth/signup.yml"
11+
- runFlow: "auth/login.yml"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Fetches test user from API
2+
function getTestUserFromApi() {
3+
const url = `https://jsonplaceholder.typicode.com/users/1`;
4+
var response = http.get(url);
5+
var data = json(response.body);
6+
7+
return {
8+
username: data.username,
9+
email: data.email,
10+
};
11+
}
12+
13+
output.test_user = getTestUserFromApi();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
function username() {
2+
var date = new Date().getTime().toString();
3+
var username = `test_user_placeholder`.replace("placeholder", date);
4+
return username;
5+
}
6+
7+
function email() {
8+
var date = new Date().getTime().toString();
9+
var email = `[email protected]`.replace("placeholder", date);
10+
return email;
11+
}
12+
13+
function password() {
14+
var date = new Date().getTime().toString();
15+
var password = `test-user-password-placeholder`.replace("placeholder", date);
16+
return password;
17+
}
18+
19+
output.credentials = {
20+
email: email(),
21+
password: password(),
22+
username: username(),
23+
};

0 commit comments

Comments
 (0)