LY
Size: a a a
LY
SR
public class Example {
private SelenideElement mainDiv = $(By.id("main_div"));
private SelenideElement mainDivAnother = $(By.id("main_div_another"));
private By saveButton = By.id("save button");
private By saveButton2 = By.id("save button2");
private SelenideElement currentElement;
public Example() {
super();
}
public Step getMainDiv() {
currentElement = mainDiv;
return new Step();
}
public Step2 getAnotherMainDiv(){
currentElement = mainDivAnother;
return new Step2();
}
class Step{
public SelenideElement saveButton(){
return currentElement.$(saveButton);
}
}
class Step2{
public SelenideElement saveButton2(){
return currentElement.$(saveButton2);
}
}
}
Я имелл ввиду что то в духе такого)AV
AV
SR
public class Example {
private SelenideElement mainDiv = $(By.id("main_div"));
private SelenideElement mainDivAnother = $(By.id("main_div_another"));
private By saveButton = By.id("save button");
private By saveButton2 = By.id("save button2");
private SelenideElement currentElement;
public Example() {
super();
}
public Step getMainDiv() {
currentElement = mainDiv;
return new Step();
}
public Step2 getAnotherMainDiv(){
currentElement = mainDivAnother;
return new Step2();
}
class Step{
public SelenideElement saveButton(){
return currentElement.$(saveButton);
}
}
class Step2{
public SelenideElement saveButton2(){
return currentElement.$(saveButton2);
}
}
}
Я имелл ввиду что то в духе такого)AV
AS
AS
public class Page1public class Page2AS
login объекта Page1 возвращает инстанс Page2.SR
AS
SR
SR
SR
SV
SV
LY
A
A
A