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

Test create new lineage structure #243

Open
lorerod opened this issue Feb 24, 2023 · 17 comments
Open

Test create new lineage structure #243

lorerod opened this issue Feb 24, 2023 · 17 comments

Comments

@lorerod
Copy link

lorerod commented Feb 24, 2023

Exploratory testing of creation of people and places.

The hierarchy is currently

  • project ->Health facility->VHT Area -> HH
    This might change soon to(probably next month):
    Region->District->Health facility->VHT Area->HH
@lorerod
Copy link
Author

lorerod commented Feb 24, 2023

cht-core version: 4.1
cht-android version: v0.8.0-5

Tester Phone details Android System WebView version Android OS version APK Results Notes
Bede
Lorena Samsung Galaxy J7 8.1.0 android-v0.8.0-5-unbranded_test-xwalk Failed More details about the test here
Tatiana Samsung Galaxy A01 110.0.5481.65 10 android-v0.8.0-5-unbranded_test-webview Passed More details about the test here

@tatilepizs
Copy link

tatilepizs commented Feb 28, 2023

Test notes - Android 10

Details about the tests performed for this ticket.

About the app ℹ️

Details about the cht-core version and cht-android version

image
Create a Project ✅

Created using the example provided in the document

{
"_id": "icohs",
"parent": "",
"type": "contact",
"contact_type": "app_instance",
"name": "iCoHS App",
"meta": {
"created_by": "medic",
"created_by_person_uuid": "",
"created_by_place_uuid": ""
},
"reported_date": 1624579200000
}
image
Create Health Facility ✅

Health Facility was created and edited with no issues.

image
Create VHT Area ⚠️

The VHT area was created and edited with no issues, but after the creation a task was triggered with the name of StockOut, that task is available in the Tasks section of the app, but it is not available in the task section of the vht Area information.

image

--

image
Create Household ✅

Household was created and edited with no issues.

image

NOTE: I saw some weird things related to date, for example, the Phone number and Alternative phone number fields are not shown if the Date radio button is selected, I need to select the Current date option to see them. I am adding this just as extra information, because I think it is related to the issue related to DOB that was raised already in this document

Video attached
Screen.Recording.2023-02-28.at.5.23.02.PM.mov

@lorerod
Copy link
Author

lorerod commented Mar 1, 2023

Test notes - Android 8.1

Details about the tests performed for this ticket.

About the app ℹ️

Details about the cht-core version and cht-android version

aboutApp

Create Health Facility ⚠️

Using an online user Health Facility was created with issues.
The District was created, creating also a new person as Primary Contact, but:

  1. During the creation of the new person some form's fields where missing (Phone number, Alternate Phone number, Sex*, Role, External ID, notes). I was able to continue with the next form page (generated name). Just by clicking the submit button it took me back to the first page (new person) because the field Sex is required.
  2. The new person's Age was not set.
Create.Health.Facility2.mov
Create VHT Area ⚠️

Using an online user the VHT Area was created, creating also a new person as Primary Contact, but:

  1. The new person's Age was not set.
Create.VHT.Area2.mov
Create Household ❌

Using an offline user and an offline user I wasn't able to create the Household. "Error Loading Form." message appeared.

household error

Create and Edit Person ❌

Using an offline user I wasn't able to create or edit a Person. "Error Loading Form." message appeared.

Screenshot_20230302-130232_CHT Android
Screenshot_20230302-130223_CHT Android

@tatilepizs
Copy link

tatilepizs commented Mar 1, 2023

Test - Android 9

Trying to create a Household using Android 9 and I see the same behavior that Lorena reported in the previous comment

Error Log
03-01 15:03:53.742 15663 15663 I chromium: [INFO:CONSOLE(1)] "Data node: /*/meta/deprecatedID with null-based index: undefined not found. Ignored.", source: https://192-168-86-210.local-ip.plip.com:10445/main.js (1)
03-01 15:03:53.995 15663 15663 I chromium: [INFO:CONSOLE(1)] "[object Object]", source: https://192-168-86-210.local-ip.plip.com:10445/main.js (1)
03-01 15:03:54.000 15663 15663 I chromium: [INFO:CONSOLE(1)] "Failed during the form "contact:clinic:create" rendering : ", source: https://192-168-86-210.local-ip.plip.com:10445/main.js (1)
03-01 15:03:54.008 15663 15663 I chromium: [INFO:CONSOLE(1)] "Error loading contact form.", source: https://192-168-86-210.local-ip.plip.com:10445/main.js (1)
Image attached image image

@dianabarsan
Copy link
Member

@tatilepizs Can you please check if there are any feedback documents submitted?
If not, can you please submit a feedback doc immediately after you see this error and then sync up and share the contents of the feedback doc?

@tatilepizs
Copy link

@dianabarsan the feedback document was created after the failure.
Here it is.

@dianabarsan
Copy link
Member

dianabarsan commented Mar 2, 2023

Sharing the relevant bit here:

Failed during the form \"contact:clinic:create\" rendering : [\"FormLogicError:
 Could not evaluate: if(selected( ../contact_dob_method,'calendar'),  
../dob_calendar, concat(format-date-time(today(),\\\"%Y\\\") - 
 /model/instance[1]/data/contact/age ,'-',format-date-time(today(),\\\"%m\\\"),'-',format-date-time(today(),\\\"%d\\\")) ), 
message: globalThis is not defined

Thanks you so much @tatilepizs for the very quick reply!

@dianabarsan
Copy link
Member

This points to openrosa-extensions referring to globalThis.

@dianabarsan
Copy link
Member

@lorerod
Copy link
Author

lorerod commented Mar 2, 2023

@dianabarsan, @jkuester is there a known workaround for this error?

@lorerod
Copy link
Author

lorerod commented Mar 2, 2023

@dianabarsan @tatilepizs adding the logs for Edit and Create Person
Edit Person:

Failed during the form \"contact:person:edit\" rendering : [\"FormLogicError: Could not evaluate: format-date-time(today(),\\\"%Y\\\") -../age_years, message: globalThis is not defined\

Create Person:

Failed during the form \"contact:person:create\" rendering : [\"FormLogicError: Could not evaluate: format-date-time(today(),\\\"%d\\\"), message: globalThis is not defined\

@dianabarsan
Copy link
Member

I'm tempted to try out a polyfill, just to see if there are further errors.
I picked one option from this guy's post an pushed it to a branch

@jkuester
Copy link

jkuester commented Mar 2, 2023

What crazy person added globalThis to OpenRosa????

image

Son of a..... 🤦

@dianabarsan
Copy link
Member

dianabarsan commented Mar 2, 2023

I'm tempted to try out a polyfill,

Another option is to patch openrosa to remove that line. At the time of the polyfill suggestion, I thought that line was critical in some way, but based on the commit message it might not be. So a patch will be less risky.
@jkuester is that something that can be done easily?

@tatilepizs
Copy link

tatilepizs commented Mar 2, 2023

Thank you @dianabarsan for all your help!

Trying Diana's branch 4.1.x-globalthis, and Android 9 (xwalk apk) the problem was fixed and all the forms worked fine.

About the app ℹ️ image
Create a Household ✅ image image
Create / edit a person ✅ image image
Pregnancy form ✅ image

@jkuester
Copy link

jkuester commented Mar 2, 2023

Regarding patching OpenRosa, I don't think there is anything in particular that would complicate the patch. @dianabarsan noted, there is no functional effect to reverting that particular line to how it was before globalThis. Currently we are not patching anything in OpenRosa, but there is no reason we cannot add this to the list.

Another option worth weighing is just adding a custom implementation of format-date that would override the OpenRosa one. (But that would probably be harder than a patch).

@dianabarsan
Copy link
Member

Another option worth weighing is just adding a custom implementation of format-date that would override the OpenRosa one. (But that would probably be harder than a patch).

I agree, I had thought about it as well but considered it the riskiest of all options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants