Skip to content

Commit

Permalink
Adding two threads of execution, one that measures
Browse files Browse the repository at this point in the history
  • Loading branch information
augustocristian committed Aug 20, 2024
1 parent 9881f9c commit 841efb6
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,25 @@ void testCancelOrder() throws ElementNotFoundException {
expectedStatesPriorCancelling.add("stockconfirmed");
LinkedList<String> expectedStatesPostCancelling = new LinkedList<>();
expectedStatesPostCancelling.add("cancelled");
LinkedList <String> expectedStatesBeforeLongDelay = new LinkedList<>();
expectedStatesBeforeLongDelay.add("paid");

login();
toOrdersPage(driver, waiter);
createOrder();
long startTime = System.currentTimeMillis();
checkLastOrderState( expectedStatesPriorCancelling);
cancelLastOrder();
long endTime = System.currentTimeMillis();
long duration =endTime-startTime;
log.debug("The time invested in place the order was: {}s", duration);
if(duration<=3000) {
cancelLastOrder();
checkLastOrderState(expectedStatesPostCancelling);
}
else {
checkLastOrderState(expectedStatesBeforeLongDelay);
}

checkLastOrderState( expectedStatesPostCancelling);
logout();
}

Expand Down

0 comments on commit 841efb6

Please sign in to comment.