Skip to content

Commit

Permalink
Auto-complete scenario should be more realistic
Browse files Browse the repository at this point in the history
  • Loading branch information
quantranhong1999 committed Apr 28, 2022
1 parent 7cbe8fe commit 60e8b88
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ class TmailContactAutocompleteScenario {
.exec(SessionStep.retrieveAccountId)
.exec(JmapMailbox.provisionUsersWithMessages(recipientFeeder, numberOfMessages = 5))
.pause(2 seconds)
.randomSwitch(
70.0 -> exec((session: Session) => session.set(typeaheadKeyword, randomSubString(session.attributes(recipientSessionParam).asInstanceOf[String]))),
30.0 -> exec((session: Session) => session.set(typeaheadKeyword, Random.alphanumeric.take(5).mkString(""))))
.during(duration) {
exec(JmapTmailContact.getAutocomplete(typeaheadKeyword = typeaheadKeyword)
.check(statusOk, noError))
randomSwitch(
70.0 -> exec((session: Session) => session.set(typeaheadKeyword, randomSubString(session.attributes(recipientSessionParam).asInstanceOf[String]))),
30.0 -> exec((session: Session) => session.set(typeaheadKeyword, Random.alphanumeric.take(5).mkString(""))))
.exec(JmapTmailContact.getAutocomplete(typeaheadKeyword = typeaheadKeyword).check(statusOk, noError))
.pause(2 seconds)
}

private def randomSubString(input: String): String = {
Expand Down

0 comments on commit 60e8b88

Please sign in to comment.