upload
This commit is contained in:
parent
295204768e
commit
7957d1cffa
0
selenide_series/src/test/data/sample.png
Normal file
0
selenide_series/src/test/data/sample.png
Normal file
31
selenide_series/src/test/java/specs/UploadTest.java
Normal file
31
selenide_series/src/test/java/specs/UploadTest.java
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
package specs;
|
||||||
|
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
import static com.codeborne.selenide.Condition.text;
|
||||||
|
import static com.codeborne.selenide.Selenide.$;
|
||||||
|
import static com.codeborne.selenide.Selenide.open;
|
||||||
|
|
||||||
|
public class UploadTest {
|
||||||
|
@Test
|
||||||
|
public void testUploadFileOnVisibleInput() {
|
||||||
|
open("https://the-internet.herokuapp.com/upload");
|
||||||
|
// upload file
|
||||||
|
$("#file-upload").uploadFile(new File("src/test/data/sample.png"));
|
||||||
|
// click upload button
|
||||||
|
$("#file-submit").click();
|
||||||
|
// verify successful text
|
||||||
|
$("h3").shouldHave(text("File Uploaded!"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testUploadFileOnHiddenInput() {
|
||||||
|
open("https://practice.sdetunicorns.com/cart/");
|
||||||
|
// https://www.youtube.com/watch?v=MA8QC4Eoaps&list=PL6AdzyjjD5HC4NJuc083bzFq86JekmASF&index=6
|
||||||
|
// dodělat můžu zkusit u svůj způsob bez toho mazání tam
|
||||||
|
// upload file
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
BIN
selenide_series/target/test-classes/specs/UploadTest.class
Normal file
BIN
selenide_series/target/test-classes/specs/UploadTest.class
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user