Skip to content

Commit

Permalink
Add new test
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Nguyen Duc <[email protected]>
  • Loading branch information
VietND96 committed Dec 4, 2023
1 parent 61c3bc0 commit 68d4035
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/test/java/com/demoqa/DownloadTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.demoqa;

import org.ndviet.library.WebUI;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

import static org.ndviet.library.TestObject.ObjectRepository.findTestObject;
public class DownloadTest {
@Parameters("browser")
@BeforeMethod
public void beforeTest(String browser) {
WebUI.openBrowser(browser, "https://demoqa.com/upload-download");
}

@AfterMethod
public void afterTest() {
//WebUI.closeBrowser();
}

@Test
public void BasicTest() throws Exception {
WebUI.verifyElementPresent(findTestObject("DemoQA.UploadDownload.btnDownload"));
WebUI.click(findTestObject("DemoQA.UploadDownload.btnDownload"), 20);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DemoQA:
UploadDownload:
btnDownload: xpath=//a[contains(text(), "Download")]
9 changes: 9 additions & 0 deletions src/test/resources/suites/DemoQA_Download.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
<suite name="DemoQA_Download" parallel="methods" thread-count="1">
<test name="ChromeTest">
<parameter name="browser" value="chrome"/>
<classes>
<class name="com.demoqa.DownloadTest"/>
</classes>
</test>
</suite>

0 comments on commit 68d4035

Please sign in to comment.