-
Notifications
You must be signed in to change notification settings - Fork 2
Unit and UI testing of ClimApp
Henriette Steenhoff edited this page May 16, 2019
·
3 revisions
- Framework: Jest
- Overview of implementation process found in: https://github.com/frksteenhoff/ClimApp/issues/96
- Description of different types of testing: https://codeutopia.net/blog/2015/04/11/what-are-unit-testing-integration-testing-and-functional-testing/
test('description of what test is doing', () => {
expect(<function to test>).toBe(<expected result>);
});
Example
test('Temperature is 12 degrees celcius when input unit is "SI" and temperature is 12 degrees', () => {
expect(dash.getTemperatureValueInPreferredUnit(12, "SI")).toBe(12);
});
ClimApp/cordova/climapp/www/js*
ClimApp/cordova/climapp/www/js/test*
npm run test
- Framework: Appium
- Guide to setup and understanding Appium and WebDriver API: https://docs.microsoft.com/en-us/visualstudio/cross-platform/tools-for-cordova/debug-test/appium-setup?view=toolsforcordova-2017
Appium lets you create a flow of actions to be performed in sequence. When you run the test it checks that all actions can be performed and fails otherwise. Below is added the navigation flow to move from the dashboard to the settings, choosing feedback and inputting some data which will be sent as feedback.
Appium uses the id tags of the different elements in the code to navigate.
appDriver.init(config.android19)
.sleep(3000)
.elementById('settings_nav')
.click()
.elementById('settings_feedback')
.click()
.elementById('1star1')
.click()
.elementById('2star2')
.click()
.elementById('3star3')
.click()
.elementById('feedback_text')
.sendKeys('Automated testing sequence added!')
.elementById('feedback_button')
.click()
.sleep(3000)
.quit();
Framework: Jenkins Credentials: ask Henriette for them
Basically, when a new commit is added to master, the project will be built and all tests in project will be run. If tests are failing the developers will be made aware of where the code is failing and can fix it right away.

- Recommended Alert Limit
- Weather data
- Shared preferences
- Translation procedure
- Prediction of indoor temperature
Testing
Server/database/API
User information
- Acclimatization
- Activity level
- Age
- Age onboarding
- Gender
- Height value
- Unit
- Weight
- Wet Bulb Globe Temperature (WBGT)
Flow controls