Skip to content

Commit

Permalink
Merge branch '9471-ui-nav-image-test-contact-user-management' of http…
Browse files Browse the repository at this point in the history
…s://github.com/medic/cht-core into 9471-ui-nav-image-test-contact-user-management
  • Loading branch information
Maria Lorena Rodriguez Viruel committed Nov 19, 2024
2 parents d6bf6f1 + c8dbf51 commit 670ed79
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('Creating and editing contacts and users', () => {

//create chw area and chw
await commonPage.clickFastActionFAB({ waitForList: false });
await browser.pause(150);
await browser.pause(150); // Waiting for animation to avoid blurry screenshots
await generateScreenshot('new-chw-area', 'new-chw-area');
await commonPage.closeFastActionList();
await commonPage.clickFastActionFAB({ actionId: 'health_center' });
Expand Down Expand Up @@ -67,7 +67,7 @@ describe('Creating and editing contacts and users', () => {
await contactPage.selectLHSRowByText(healthFacilityName);
await searchPage.clearSearch();
await commonPage.clickFastActionFAB({ waitForList: false });
await browser.pause(150);
await browser.pause(150); // Waiting for animation to avoid blurry screenshots
await generateScreenshot('new-chw-supervisor', 'new-person');
await commonPage.closeFastActionList();
await commonPage.clickFastActionFAB({ actionId: 'person' });
Expand All @@ -79,7 +79,7 @@ describe('Creating and editing contacts and users', () => {
await contactPage.selectLHSRowByText(healthFacilityName);
await searchPage.clearSearch();
await commonPage.openMoreOptionsMenu();
await browser.pause(150);
await browser.pause(150); // Waiting for animation to avoid blurry screenshots
await generateScreenshot('new-chw-supervisor', 'edit-facility');
await (await contactPage.menuSelectors.editContactButton()).waitForClickable();
await (await contactPage.menuSelectors.editContactButton()).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('Contact and User Management', () => {
contactSummaryExtras: contactSummaryExtrasFile
});
await utils.updateSettings(
{ contact_summary: contactSummary},
{ contact_summary: contactSummary },
{ revert: true, ignoreReload: true, refresh: true, sync: true }
);
await commonPage.waitForPageLoaded();
Expand Down
2 changes: 1 addition & 1 deletion tests/factories/cht/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const createAdditionalPersons = (nbrPersons, clinic, ageType) => {

return personFactory.build({
parent: { _id: clinic._id, parent: clinic.parent },
name: additionalPersonName,
name: `${name} ${clinic.last_name}`,
patient_id: PATIENT_IDS[i % PATIENT_IDS.length],
phone: additionalPhoneNumber,
date_of_birth: date_of_birth,
Expand Down
15 changes: 5 additions & 10 deletions tests/page-objects/default/contacts/contacts.wdio.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,15 @@ const deathCardSelectors = {
deathPlace: () => $(`${DEATH_CARD_TEST_ID} div[test-id="contact.profile.death.place"] p.card-field-value`),
};

const INMUNIZATION_CARD_TEST_ID = `div[test-id="contact.profile.immunizations"]`;
const inmunizationCardSelectors = {
inmunizationCard: () => $(INMUNIZATION_CARD_TEST_ID),
inmunizationCard: () => $('div[test-id="contact.profile.immunizations"]'),
};

const PRIMARY_CONTACT_SEARCH_DROPDOWN =
'span.select2-selection--single' +
'[aria-labelledby^="select2-/data/district_hospital/contact/_id"]';
const PRIMARY_CONTACT_SEARCH_INPUT = 'input.select2-search__field';
const PRIMARY_CONTACT_SEARCH_RESULT = '.select2-results__option--highlighted';
const editDistrictHospitalSelectors = {
primaryContactSearchDropdown: () => $(PRIMARY_CONTACT_SEARCH_DROPDOWN),
primaryContactSearchInput: () => $(PRIMARY_CONTACT_SEARCH_INPUT),
primaryContactSearchFirstResult: () => $(PRIMARY_CONTACT_SEARCH_RESULT),
primaryContactSearchDropdown: () => $( 'span.select2-selection--single' +
'[aria-labelledby^="select2-/data/district_hospital/contact/_id"]'),
primaryContactSearchInput: () => $('input.select2-search__field'),
primaryContactSearchFirstResult: () => $('.select2-results__option--highlighted'),
};

const sortMenuSelectors = {
Expand Down

0 comments on commit 670ed79

Please sign in to comment.