this.Given(/^the user has right clicked and selected '(.*)' for miscellaneous field 5$/,
(value: any) =>
this.stage.theActorInTheSpotlight().attemptsTo(
Wait.until(MiscellaneousFieldsElements.miscFieldId5, Is.visible()),
Clear.theValueOf(MiscellaneousFieldsElements.miscFieldId5),
Enter.theValue(' ').into(MiscellaneousFieldsElements.miscFieldId5).thenHit(webdriver.Key.BACK_SPACE),
//browser.actions().click(MiscellaneousFieldsElements.miscFieldId5, Button.RIGHT).perform(),
browser.actions().mouseMove(MiscellaneousFieldsElements.miscFieldId5).click().perform()
)
);
目标守则: 出口类目标{
static the = (name: string) => ({
located: (byLocator: Locator): Target => new Target(name, byLocator),
})
of(...tokenReplacements: Array<string|number>): Target {
return new Target(describeAs(this.name, ...tokenReplacements), new Interpolated(this.locator).with(tokenReplacements));
}
called(newName: string): Target {
return new Target(newName, this.locator);
}
resolveUsing(resolver: (locator: Locator) => ElementFinder): ElementFinder {
return resolver(this.locator);
}
resolveAllUsing(resolver: { all: (locator: Locator) => ElementArrayFinder }): ElementArrayFinder {
return resolver.all(this.locator);
}
toString(): string {
return `the ${ this.name }`;
}
constructor(private name: string, private locator: Locator) {
}
}
参数类型目标无法分配给参数类型Webelement | Location.Target无法分配到类型Location.Parameter x在Target中缺失。 我该如何解决这个问题?