Skip to content
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

chore(#9483): initial setup of apdex automation in cht-core #9037

Merged
merged 38 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
9270743
initial-setup-of-apdex-automation-in-cht-core
Apr 22, 2024
643b3a8
Merge branch 'master' into apdex-automation-tests
ralfudx Apr 23, 2024
95bb115
fixed-linting-issues
Apr 23, 2024
2af7986
merge-master
Apr 23, 2024
c36db46
lint-indentation
Apr 24, 2024
53644af
lint-to-fix-unused-vars
Apr 24, 2024
76d46e3
lint-fix-undef-vars
Apr 24, 2024
c020d68
lint-fixed-catch-or-return
Apr 24, 2024
5b8b124
final-lint-fix
Apr 24, 2024
5d8dff0
chore: adds settings file to apdex tests (#9068)
latin-panda Apr 30, 2024
99973ac
feat: apdex tests with script - navigation and retry (#9075)
latin-panda May 9, 2024
5697137
feat: apdex tests with script - fill up forms (#9105)
latin-panda May 16, 2024
3a2f4f7
chore(#109): Run test suite from the apdex test automation branch (#9…
ralfudx May 21, 2024
9a0400a
chore: Add logic to fill up a report form that generates a task using…
ralfudx Jun 10, 2024
2005ef6
Merge branch 'master' into apdex-automation-tests
Jul 10, 2024
926c366
chore: complete apdex automation tasks (#9247)
ralfudx Jul 22, 2024
8b40463
Merge branch 'master' into apdex-automation-tests
ralfudx Jul 22, 2024
f696aa5
feat: apdex skip tests on demand and cleaning (#9274)
latin-panda Jul 30, 2024
4f99819
changed-log-path
Aug 20, 2024
7142232
merged-master
Aug 20, 2024
baec86c
lint
Aug 20, 2024
6728cb1
lint2
Aug 20, 2024
236d997
did-npm-install-on-this-branch
Aug 20, 2024
ba96751
added-typescript-5.3.3
Aug 21, 2024
f7861eb
Merge branch 'master' into apdex-automation-tests
Aug 23, 2024
8c783c8
added-requested-changes
Aug 23, 2024
6e43ad6
lint
Aug 23, 2024
6f9e91d
instantiate-load-settings-from-class
Aug 27, 2024
f8a9c22
Merge branch 'master' into apdex-automation-tests
Aug 27, 2024
13dd81c
Merge branch 'master' into apdex-automation-tests
ralfudx Aug 28, 2024
2aaa289
Merge branch 'master' into apdex-automation-tests
ralfudx Aug 29, 2024
8a7deba
added-requested-changes
Aug 29, 2024
a6f82b2
Merge branch 'master' into apdex-automation-tests
ralfudx Aug 29, 2024
7f6f112
lint
Aug 29, 2024
a94a7b2
lint2
Aug 29, 2024
e26c6c4
added fix for SonarCloud Code Analysis checks
Aug 29, 2024
6bc1033
lint
Aug 29, 2024
d1b2a41
Merge branch 'master' into apdex-automation-tests
ralfudx Aug 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9,152 changes: 7,799 additions & 1,353 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"unit-cht-deploy": "cd scripts/deploy && npm test",
"wdio-default-mobile-local": "export VERSION=$(node ./scripts/build/get-version.js) && ./scripts/build/build-service-images.sh && wdio run ./tests/e2e/default-mobile/wdio.conf.js --suite=all",
"wdio-local": "export VERSION=$(node ./scripts/build/get-version.js) && ./scripts/build/build-service-images.sh && wdio run ./tests/e2e/default/wdio.conf.js",
"apdex-test": "wdio run ./tests/performance/apdex-score/wdio.conf.js",
"-- CI SCRIPTS ": "-----------------------------------------------------------------------------------------------",
"build": "./scripts/build/build-ci.sh",
"ci-compile": "node scripts/ci/check-versions.js && node scripts/build/cli npmCiModules && npm run lint && npm run unit-nginx && npm run unit-haproxy && npm run unit-haproxy-healthcheck && npm run unit-cht-deploy && npm run build && npm run integration-api && npm run unit",
Expand Down Expand Up @@ -87,12 +88,14 @@
"@typescript-eslint/eslint-plugin": "7.5",
"@typescript-eslint/parser": "7.5",
"@wdio/allure-reporter": "^8.34.0",
"@wdio/appium-service": "^8.36.1",
"@wdio/cli": "^8.35.1",
"@wdio/devtools-service": "^8.35.1",
"@wdio/local-runner": "^8.35.1",
"@wdio/mocha-framework": "^8.35.0",
"@wdio/spec-reporter": "^8.32.4",
"allure-commandline": "^2.24.0",
"appium-uiautomator2-driver": "^3.0.0",
"browserify": "^17.0.0",
"browserify-ngannotate": "^2.0.0",
"chai": "^4.3.8",
Expand Down
41 changes: 41 additions & 0 deletions tests/page-objects/apdex/contacts.page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const Page = require('@page-objects/apdex/page');
const CONTACT_LIST = 'contactList';
const CHW_AREA = 'chwArea';
const HOUSEHOLD = 'household';
const PATIENT = 'patient';
const PATIENT_REPORT = 'patientReport';
const PATIENT_CONTACT = 'patientContact';

class ContactsPage extends Page {

async loadContactList() {
await super.loadPage(CONTACT_LIST);
}

async loadChwArea() {
await super.loadPage(CHW_AREA);
}

async loadHousehold() {
await super.loadPage(HOUSEHOLD);
}

async loadPatient() {
await super.loadPage(PATIENT);
}

async searchContact() {
await super.searchPage(CONTACT_LIST);
}

async submitPatientReport() {
await super.loadForm(PATIENT_REPORT);
}

async createPatient() {
await super.loadForm(PATIENT_CONTACT);
}

}

module.exports = new ContactsPage();
36 changes: 36 additions & 0 deletions tests/page-objects/apdex/load.page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const Page = require('@page-objects/apdex/page');
const CUSTOM_INSTANCE = 'Custom';

class LoadPage extends Page {

get inputInstanceUrl() {
return $('//android.widget.EditText[@resource-id="org.medicmobile.webapp.mobile:id/txtAppUrl"]');
}

get btnSave() {
return $('//android.widget.Button[@resource-id="org.medicmobile.webapp.mobile:id/btnSaveSettings"]');
}

async loadInstance() {
const isServerSettings = await super.isLinkExisting(CUSTOM_INSTANCE);
// Check if the app has opened and the custom linktext is displayed before proceeding
if (!isServerSettings) {
return;
}

await super.toggleAirplaneMode('off');
await super.clickLink(CUSTOM_INSTANCE);
await this.inputInstanceUrl.setValue(super.getSettingsProvider().getInstanceURL());
await this.btnSave.click();
}

async turnOnAirplaneMode() {
const commonElements = super.getSettingsProvider().getCommonElements();
const UI_ELEMENT = commonElements?.relaunchAppAssert || super.getLinkSelector('People');
await this.waitForDisplayedAndRetry(UI_ELEMENT);
await super.toggleAirplaneMode('on');
}

}

module.exports = new LoadPage();
29 changes: 29 additions & 0 deletions tests/page-objects/apdex/login.page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const Page = require('@page-objects/apdex/page');

class LoginPage extends Page {

get inputUsername() {
return $('//android.view.View[@text="User name"]//parent::android.view.View/android.widget.EditText');
}

get inputPassword() {
return $('//*[@text="Password"]//parent::android.view.View/android.view.View/android.widget.EditText');
}

async login(userType, userRole) {
await this.inputUsername.waitForDisplayed();

const user = super.getSettingsProvider().getUser(userType, userRole);
await this.inputUsername.setValue(user.username);
await this.inputPassword.setValue(user.password);

await super.clickButton('Login');

if (super.getSettingsProvider().hasPrivacyPolicy()) {
await super.clickButton('Accept');
}
}

}

module.exports = new LoginPage();
12 changes: 12 additions & 0 deletions tests/page-objects/apdex/messages.page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const Page = require('@page-objects/apdex/page');
const MESSAGE_LIST = 'messageList';

class MessagesPage extends Page {

async loadMessageList() {
await super.loadPage(MESSAGE_LIST);
}

}

module.exports = new MessagesPage();
Loading