You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following is a snippet of a PO which won't be detected properly
import { browser, by, By, element, $, $$, protractor, ElementFinder, ExpectedConditions, ElementArrayFinder } from 'protractor';
import * as webdriver from 'selenium-webdriver';
export class MyPO extends MyAbstractPO { // This line won't be detected
bar = 'foo'; // This will be the only line detected
private baz : Foo = new Foo();
constructor() {
super();
}
public fubar(bar: string) { // This method won't be detected
}
get foobar() { //This method won't be detected
}
set foobaz(baz: Foo) { //This method won't be detected
}
}
The text was updated successfully, but these errors were encountered:
Please advice - what elements should be detected as objects for current page?
We have some functions in our page objects pages, but I didn't include them due to no needs in our feature files. Will you use something like "page"."fubar" in your tests ?
Getters and Setters should be detected in my point of view. You can do MyPO.foobar is 'foo' and "I select 'bar' in MyPO.foobaz"
A far fetched example could be this:
// Features/definitions/Foo.feature
[...]
Given Bar.Name is 'foo' and Bar.Password is 'bar'
// features/PO/Bar.ts
export class Bar {
Name = '';
private password : string;
set Password(pwd: String) {
this.password = pwd;
}
}
// Features/Steps/MySteps.steps.ts
export class MySteps {
private po : Bar = new Bar();
public parseAndExecuteIf(str : string) {
// Regex (.* is .*) and execute it
}
@given("/(.* is .*) and (.* is .*)/")
public foobar(username, password) {
this.parseAndExecuteIf(username);
this.parseAndExecuteIf(password)
}
}
Following is a snippet of a PO which won't be detected properly
The text was updated successfully, but these errors were encountered: