Skip to content

Commit

Permalink
feat(core): dynamic descriptions for Wait.for and Wait.until
Browse files Browse the repository at this point in the history
Related tickets: re #2223
  • Loading branch information
jan-molak committed Jun 14, 2024
1 parent 3fdc7c8 commit d000f46
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/core/src/screenplay/time/activities/Wait.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { d } from '../../../io';
import type { UsesAbilities } from '../../abilities';
import type { Answerable } from '../../Answerable';
import { Interaction } from '../../Interaction';
import type { AnswersQuestions, Expectation, ExpectationOutcome } from '../../questions';
import type { AnswersQuestions, Expectation, ExpectationOutcome} from '../../questions';
import { the } from '../../questions';
import { ExpectationMet } from '../../questions';
import { ScheduleWork } from '../abilities';
import { Duration } from '../models';
Expand Down Expand Up @@ -202,7 +203,7 @@ export class Wait {
*/
class WaitFor extends Interaction {
constructor(private readonly duration: Answerable<Duration>) {
super(d`#actor waits for ${ duration }`);
super(the`#actor waits for ${ duration }`);
}

async performAs(actor: UsesAbilities & AnswersQuestions): Promise<void> {
Expand Down Expand Up @@ -231,7 +232,7 @@ export class WaitUntil<Actual> extends Interaction {
private readonly pollingInterval: Duration,
private readonly timeout?: Duration,
) {
super(d`#actor waits until ${ actual } does ${ expectation }`);
super(the`#actor waits until ${ actual } does ${ expectation }`);

if (timeout) {
ensure('Timeout', timeout.inMilliseconds(), isGreaterThanOrEqualTo(Wait.minimumTimeout.inMilliseconds()));
Expand Down

0 comments on commit d000f46

Please sign in to comment.