[Resolved]Creation of Conditions workflow as an independent workflow

During yesterday’s QA meeting, i shared my experience while working on [RATEST-242] New E2E Test: Conditions Workflow - OpenMRS Issues where i was basically dealing with fixing the ignored scenarios in the conditions test workflow. However the experience was not appealing since currently that test workflow is embedded in All Firefox Tests henceforth having to endure the pain of waiting for all these other tests (30+ minutes) to get executed before i could observe the effect of e.g a small change i made in the conditions.feature file. And in case one of the prior test-work-flows fails , i wont be able to get to the test-flow(conditions) i want or working on.

It is on that background that i suggested the separation of the conditions workflow from the All Firefox Tests. The conditons feature file has 6 scenarios as can be observed here and i think it is fit to stand on its own as a separate/independent workflow.

And it is to that effect that i have been advised to include that work in the ticket here that am currently working on rather than creating a new jira ticket for it.

Any objection & advice to that effect is welcome, thanks in advance! cc: @christine @sharif @kdaud @dkayiwa @ndacyayisenga @jonathan

I second the idea! It will even make work simpler in future when figuring out a test that may fail during build plans.

This would mean writing its own workflow that will trigger the test to run during CI. Take a leaf on some of the existing workflow for example 2.x RefApp refapp-2.x-user-account.yml and you will need to create a customized hook in RunTest file to have something like;

public class RunTest {

	public class HOOK {
        public static final String SELENIUM = "@selenium";
		public static final String CONDITION = "@condition";
		public static final String SELENIUM_CONDITION = SELENIUM + " and " + CONDITION ;
   }
}

And then invoke the RunTest.HOOK.SELENIUM_CONDITION within the selenium tests on @Before and @After method. Also ensure the scenario tags in the condition feature file are changed to @selenium and @condition

1 Like

Well done @mherman22 , To add on @kdaud suggestion, it seem not quite different though. Have this as a separate workflow, Follow the same convention as suggested up by @kdaud and create a new flow, it only requires you to change few things in runTest class, updating feature file, and have conditionSteps class to convey the feature files.

1 Like

perfect :slight_smile:

thanks for the guidance @kdaud & @sharif . i guess i will have to create a script aswell in the package.json file.

1 Like

Have updated the ticket description [RATEST-242] Fix ignored Conditions Feature file - OpenMRS Issues

2 Likes

thanks for shedding more light. :handshake:

However @kdaud & @sharif you could shed more light on how i can get that badge here GitHub - openmrs/openmrs-contrib-qaframework. Does the badge come when the workflow is created or theres another procedure to follow to get that badge

This might be of help , Feel free to follow this workflow UserAccount workflow. Let us know if anything is pending will be glad to help

1 Like

thanks for the help.

TIme to get these hands dirty.

1 Like

sure :ok_hand:

1 Like

@mherman22 you need to Copy status budge markdown which is auto-generated by Github. Go to qaframework repo and Click on Actions → Then click on your workflow(check on the left side below the word Workflows) → Then click on Create status budge. This will generate a markdown code which you need to copy and add in the ReadMe.md file. See a sample of RefApp 2.x UserAccount

cc: @irenyak1 @jwnasambu @jonathan @insookwa @gracebish @ndacyayisenga

3 Likes

Your help is much appreciated :handshake:

created the Pull Request → RATEST-242 : New E2E Test: Conditions Workflow by mherman22 · Pull Request #174 · openmrs/openmrs-contrib-qaframework · GitHub Its got some build failures here Tests in error: Edit first active condition(Patient's Conditions Managment): Expected condition failed: waiting for org.openmrs.contrib.qaframework.helper.Page$1@7572ac8b (tried for 120 second(s) with 500 milliseconds interval)(..)

Edit first inactive condition(Patient's Conditions Managment): Expected condition failed: waiting for org.openmrs.contrib.qaframework.helper.Page$1@501e212f (tried for 120 second(s) with 500 milliseconds interval)(..) for a full report checkout here.

any help in pointing out what the cause could be is highly welcome @sharif @kdaud @ndacyayisenga

@mherman22 are you able to reproduce it locally?

Yes I get that locally and when I went the build failures as indicated above, its the same thing

From the logs, the issue is cited out clearly

Tests in error:


Edit first active condition(Patient's Conditions Managment): Expected condition failed: waiting for org.openmrs.contrib.qaframework.helper.Page$1@7572ac8b (tried for 120 second(s) with 500 milliseconds interval)(..)

Edit first inactive condition(Patient's Conditions Managment): Expected condition failed: waiting for org.openmrs.contrib.qaframework.helper.Page$1@501e212f (tried for 120 second(s) with 500 milliseconds interval)(..)

It seems like the current set value for EDIT condition is referencing more than one page element which is probably failing the test during its look-up. You need to inspect the page element and get a value that uniquely identifies it.

thanks for pointing me in that direction and after that call where we changed the cssSelector of the two edit elements in the editActive and editInactive funcs, i come baring bad news :slight_smile: the blocker is still the same as shown in the full log report here especially line 185 - 287.

so i was able to get rid of one error and am only remaining with this Tests in error:

Edit first inactive condition(Patient’s Conditions Managment): Expected condition failed: waiting for visibility of element located by By.cssSelector: #INACTIVE i.icon-pencil.edit-action.ng-scope (tried for 120 second(s) with 500 milliseconds interval)(…)

however when i try to add a waiting element to the element by putting this

waiter.until(ExpectedConditions .elementToBeClickable(EDIT_INACTIVE_CONDITION)); , there’s no change. any advice @kdaud

How about when you try out this

wait.until(ExpectedConditions.visibilityOfElementLocated((“EDIT_INACTIVE_CONDITION”))

i have tried but it was resulting into the same

Thanks evryone for the help, finally i get that beautiful green :four_leaf_clover: colour. let me commit the changes for review

@mherman22 do you mind sharing how the issue got sorted?