-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBaseStep.java
More file actions
35 lines (25 loc) · 822 Bytes
/
Copy pathBaseStep.java
File metadata and controls
35 lines (25 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package step;
import com.pdffiller.page.MainPage;
import io.qameta.atlas.core.Atlas;
import io.qameta.atlas.webdriver.WebPage;
import org.openqa.selenium.WebDriver;
import java.io.File;
public class BaseStep {
WebDriver driver;
Atlas atlas;
public BaseStep(WebDriver driver, Atlas atlas) {
this.driver = driver;
this.atlas = atlas;
}
private MainPage onMainPage() {
return onPage(MainPage.class);
}
<T extends WebPage> T onPage(Class<T> page) {
return atlas.create(driver, page);
}
public void uploadFile(String fileName) {
ClassLoader classLoader = getClass().getClassLoader();
File file = new File (classLoader.getResource(fileName).getFile());
onMainPage().fileUploadInput().sendKeys(file.getAbsolutePath());
}
}