-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
480 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
package com.anhtester.constants; | ||
|
||
import com.anhtester.helpers.PropertiesHelper; | ||
|
||
public class AppConfig { | ||
public static final boolean HEADLESS = false; | ||
public static boolean HEADLESS = Boolean.parseBoolean(PropertiesHelper.getValue("HEADLESS")); | ||
public static String URL = PropertiesHelper.getValue("URL"); | ||
public static String BROWSER = PropertiesHelper.getValue("BROWSER"); | ||
public static int VIEWPORT_WIDTH = Integer.parseInt(PropertiesHelper.getValue("VIEWPORT_WIDTH")); | ||
public static int VIEWPORT_HEIGHT = Integer.parseInt(PropertiesHelper.getValue("VIEWPORT_HEIGHT")); | ||
public static boolean VIDEO_RECORD = Boolean.parseBoolean(PropertiesHelper.getValue("VIDEO_RECORD")); | ||
public static boolean SCREENSHOT_FAIL = Boolean.parseBoolean(PropertiesHelper.getValue("SCREENSHOT_FAIL")); | ||
public static boolean SCREENSHOT_PASS = Boolean.parseBoolean(PropertiesHelper.getValue("SCREENSHOT_PASS")); | ||
public static int TIMEOUT_STEP = Integer.parseInt(PropertiesHelper.getValue("TIMEOUT_STEP")); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,33 @@ | ||
package com.anhtester.common; | ||
|
||
import com.anhtester.constants.AppConfig; | ||
import com.anhtester.helpers.PropertiesHelper; | ||
import com.anhtester.keywords.WebKeyword; | ||
import com.anhtester.listeners.TestListener; | ||
import com.anhtester.managers.BrowserFactory; | ||
import com.anhtester.managers.PageManager; | ||
import com.anhtester.pom.pages.CommonPage; | ||
import org.testng.annotations.*; | ||
|
||
@Listeners(TestListener.class) | ||
public class BaseTest { | ||
public class BaseTest extends CommonPage { | ||
|
||
@BeforeMethod | ||
@Parameters({"BROWSER"}) | ||
public void createBrowser(@Optional("chrome") String browserName) { | ||
BrowserFactory.createBrowser(browserName); | ||
if (AppConfig.BROWSER != null && !AppConfig.BROWSER.isEmpty()) { | ||
BrowserFactory.createBrowser(AppConfig.BROWSER); | ||
}else { | ||
BrowserFactory.createBrowser(browserName); | ||
} | ||
} | ||
|
||
@AfterMethod | ||
public void closePage() { | ||
PageManager.closePage(); | ||
PageManager.closeBrowser(); | ||
|
||
WebKeyword.closeSoftAssert(); | ||
} | ||
|
||
} |
Oops, something went wrong.