Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion docker-compose-toolshop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ services:
- "DB_PORT=3306"
- "DB_HOST=mariadb"
- "host=localhost"
- DISABLE_LOGGING=true
- DISABLE_LOGGING=${DISABLE_LOGGING}
volumes:
- laravel-app-code:/var/www

angular-ui:
image: testsmith/practice-software-testing-sprint5-ui
Expand All @@ -16,13 +18,33 @@ services:
command: >
bash -c "ng serve --host 0.0.0.0 --port 4200"

# The Web Server
web:
image: testsmith/practice-software-testing-web
ports:
- 8091:80
- 8000:81
depends_on:
- laravel-api
volumes:
- laravel-app-code:/var/www

cron:
image: testsmith/practice-software-testing-cron
restart: always
depends_on:
- mariadb
- laravel-api
volumes:
- laravel-app-code:/var/www
working_dir: /var/www
command: sh -c "crond -f -l 8"
environment:
- "PHP_OPCACHE_VALIDATE_TIMESTAMPS=1"
- "DB_PORT=3306"
- "DB_HOST=mariadb"
- "host=localhost"
- DISABLE_LOGGING=${DISABLE_LOGGING}

mariadb:
image: yobasystems/alpine-mariadb:10.6.11
Expand All @@ -35,3 +57,12 @@ services:
MYSQL_USER: user
MYSQL_PASSWORD: root
MYSQL_DATABASE: toolshop

mailcatcher:
image: dockage/mailcatcher:0.9.0
ports:
- 1025:1025 # smtp server
- 1080:1080 # web ui

volumes:
laravel-app-code:
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<surefire-version>3.5.5</surefire-version>
<maven.source.encoding>UTF-8</maven.source.encoding>
<suite-xml>testng.xml</suite-xml>
<argLine>-Dfile.encoding=UTF-8 -Xdebug -Xnoagent</argLine>
<argLine>-Dfile.encoding=UTF-8</argLine>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class RegistrationData {
private String lastName;
private String dob;
private String street;
private String houseNumber;
private String postalCode;
private String city;
private String state;
Expand Down
20 changes: 13 additions & 7 deletions src/test/java/io/github/mfaisalkhatri/pages/RegistrationPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,17 @@ public void fillRegistrationForm (final RegistrationData registrationData) {
lastNameField ().clear ();
lastNameField ().sendKeys (registrationData.getLastName ());
dobField ().sendKeys (registrationData.getDob ());
streetField ().clear ();
streetField ().sendKeys (registrationData.getStreet ());
selectCountryVisibleText (registrationData.getCountry ());
postalCodeField ().clear ();
postalCodeField ().sendKeys (registrationData.getPostalCode ());
cityField ().clear ();
cityField ().sendKeys (registrationData.getCity ());
stateField ().clear ();
stateField ().sendKeys (registrationData.getState ());
selectCountryVisibleText (registrationData.getCountry ());
houseNumber().clear();
houseNumber().sendKeys(registrationData.getHouseNumber());
//streetField ().clear ();
//streetField ().sendKeys (registrationData.getStreet ());
//cityField ().clear ();
//cityField ().sendKeys (registrationData.getCity ());
//stateField ().clear ();
//stateField ().sendKeys (registrationData.getState ());
phoneField ().clear ();
phoneField ().sendKeys (registrationData.getPhone ());
emailAddressField ().clear ();
Expand Down Expand Up @@ -103,6 +105,10 @@ private WebElement registerButton () {
return this.driver.findElement (By.cssSelector (".btnSubmit"));
}

private WebElement houseNumber () {
return this.driver.findElement(By.id("house_number"));
}

private void selectCountryVisibleText (final String countryName) {
new Select (countryField ()).selectByVisibleText (countryName);
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/io/github/mfaisalkhatri/test/BaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

public class BaseTest implements WebDriverProvider {

protected WebDriver driver;
protected WebDriver driver;

@Override
public WebDriver getDriver () {
Expand All @@ -21,7 +21,7 @@ public WebDriver getDriver () {
@BeforeClass
public void setup () {
ChromeOptions chromeOptions = new ChromeOptions ();
chromeOptions.addArguments ("--headless=new","--no-sandbox","--window-size=1920,1080");
chromeOptions.addArguments ("--headless=new", "--no-sandbox", "--window-size=1920,1080");

this.driver = new ChromeDriver (chromeOptions);
this.driver.manage ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public Iterator<RegistrationData> getValidRegistrationData () {
@Test (dataProvider = "getValidRegistrationData")
public void testRegistrationPasswordAlert (final RegistrationData registrationData) {
this.driver.get ("http://localhost:4200/");
// this.driver.get ("https://practicesoftwaretesting.com/auth/register");
// this.driver.get ("https://practicesoftwaretesting.com/auth/register");

HomePage homePage = new HomePage (driver);
LoginPage loginPage = homePage.navigateToLoginPage ();
Expand Down
3 changes: 3 additions & 0 deletions src/test/resources/testdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"dob": "1987-11-19",
"street": "11/2, Fort Street",
"postalCode": "113445",
"houseNumber": 25,
"city": "California",
"state": "Holland",
"country": "Benin",
Expand All @@ -20,6 +21,7 @@
"dob": "1985-04-23",
"street": "21/4, Dallas Street",
"postalCode": "12976",
"houseNumber": 11,
"city": "California",
"state": "Dallas",
"country": "American Samoa",
Expand All @@ -35,6 +37,7 @@
"street": "30/2, Texas Street",
"postalCode": "155642",
"city": "California",
"houseNumber": 30,
"state": "Duckberg",
"country": "Austria",
"phone": "0483678",
Expand Down
Loading