Need to automate a test case that involves filling out a form with 5 date pickers and 30 fields. Once the form is filled, a jar needs to be invoked to retrieve the data from the DB and process it independently.
Note: The jar does not send any value back to the script, but it should update the process status on the UI after 1 minute.
Tried using wait in the beforeEach() block, but it caused unnecessary delays in the script by introducing waits before each step. In one of the forum threads, some users recommended using the done function of Jasmine 2, but I am not sure how to implement it.
Sample code:
describe("Test functionality of xyz", ()=>{
// few it blocks
it();
it();
// login to the UI
it("Login to application", ()=>{
utility.signIn(inputTestdata.Common.LoginPage.Username, inputTestdata.Common.LoginPage.Password);
});
// filling the form
it("Fill the form", ()=>{
utility.fill_form(dataSet);
}); // want Protractor to wait for exactly 1 minute before executing the next it block
it("Process the data", ()=>{
utility.runSimulator();
}); // want to wait here for 2 minutes
it("Verify the result", ()=>{
// verifying the result
});
// more it blocks
});
Expected behavior: The jar invocation it block should only run after the form filling it block has been processed. Then, there should be a specified delay before proceeding to the verification result step.
However, in reality, Protractor calls the form filling it block and immediately moves on to the jar it block.