Skip to content

Commit 96cc128

Browse files
committed
fixed the date of birth field format in the test, added docker compose for toolshop website, updated the github actions workflow to use docker compose
1 parent f82c21a commit 96cc128

File tree

7 files changed

+50
-32
lines changed

7 files changed

+50
-32
lines changed

.github/workflows/maven.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,8 @@ jobs:
4646
distribution: 'adopt'
4747
cache: maven
4848

49-
- name: Checkout Practice Software Testing repo
50-
uses: actions/checkout@v4
51-
with:
52-
repository: testsmith-io/practice-software-testing
53-
path: practice-repo
54-
55-
- name: Start Practice Software Testing with Docker Compose
56-
working-directory: practice-repo
57-
run: docker compose -f docker-compose.yml up -d
49+
- name: Start Practice Software Testing ToolShop Website with Docker Compose
50+
run: docker compose -f docker-compose-toolshop.yml up -d
5851

5952
- name: Sleep for 60 seconds
6053
run: sleep 60s
@@ -63,10 +56,7 @@ jobs:
6356
- name: Create and Seed Database
6457
working-directory: practice-repo
6558
run: |
66-
docker compose exec laravel-api php artisan migrate:fresh --seed
67-
68-
- name: Install Chrome
69-
uses: browser-actions/setup-chrome@latest
59+
docker compose exec -f docker-compose-toolshop.yml laravel-api php artisan migrate:fresh --seed
7060
7161
- name: Build Project and run tests
7262
run: mvn clean install
@@ -78,6 +68,9 @@ jobs:
7868
name: test-screenshots
7969
path: screenshots
8070

71+
- name: Stop Practice Software Testing ToolShop Website
72+
run: docker compose -f docker-compose-toolshop.yml down --remove-orphans
73+
8174
- name: Test Report
8275
uses: dorny/test-reporter@v2
8376
if: success() || failure()

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
target/
22
.idea/
33
/screenshots/
4+
/API
5+
/UI
46

57
### VS Code ###
68
.vscode/

UI/package-lock.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

docker-compose-toolshop.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
version: '2'
2+
services:
3+
laravel-api:
4+
image: testsmith/practice-software-testing-sprint5-api
5+
environment:
6+
- "PHP_OPCACHE_VALIDATE_TIMESTAMPS=1"
7+
- "DB_PORT=3306"
8+
- "DB_HOST=mariadb"
9+
- "host=localhost"
10+
- DISABLE_LOGGING=true
11+
12+
angular-ui:
13+
image: testsmith/practice-software-testing-sprint5-ui
14+
ports:
15+
- 4200:4200
16+
command: >
17+
bash -c "ng serve --host 0.0.0.0 --port 4200"
18+
19+
web:
20+
image: testsmith/practice-software-testing-web
21+
ports:
22+
- 8091:80
23+
- 8000:81
24+
depends_on:
25+
- laravel-api
26+
27+
mariadb:
28+
image: yobasystems/alpine-mariadb:10.6.11
29+
ports:
30+
- 3306:3306
31+
expose:
32+
- 3306
33+
environment:
34+
MYSQL_ROOT_PASSWORD: root
35+
MYSQL_USER: user
36+
MYSQL_PASSWORD: root
37+
MYSQL_DATABASE: toolshop

src/test/java/io/github/mfaisalkhatri/pages/RegistrationPage.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void fillRegistrationForm (final RegistrationData registrationData) {
2929
firstNameField ().sendKeys (registrationData.getFirstName ());
3030
lastNameField ().clear ();
3131
lastNameField ().sendKeys (registrationData.getLastName ());
32-
dobField ().sendKeys (dateOfBirth (registrationData.getDob ()));
32+
dobField ().sendKeys (registrationData.getDob ());
3333
streetField ().clear ();
3434
streetField ().sendKeys (registrationData.getStreet ());
3535
postalCodeField ().clear ();
@@ -110,12 +110,4 @@ private WebElement streetField () {
110110
return this.driver.findElement (By.id ("street"));
111111
}
112112

113-
private String dateOfBirth (String jsonDate) {
114-
115-
DateTimeFormatter inputFormat = DateTimeFormatter.ofPattern ("dd/MM/yyyy");
116-
LocalDate date = LocalDate.parse (jsonDate, inputFormat);
117-
118-
DateTimeFormatter outputFormat = DateTimeFormatter.ofPattern ("MM/dd/yyyy");
119-
return date.format (outputFormat);
120-
}
121113
}

src/test/java/io/github/mfaisalkhatri/test/JsonDataProviderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public Iterator<RegistrationData> getValidRegistrationData () {
3232
@Test (dataProvider = "getValidRegistrationData")
3333
public void testRegistrationPasswordAlert (final RegistrationData registrationData) {
3434
this.driver.get ("http://localhost:4200/");
35-
//this.driver.get ("https://practicesoftwaretesting.com/auth/register");
35+
// this.driver.get ("https://practicesoftwaretesting.com/auth/register");
3636

3737
HomePage homePage = new HomePage (driver);
3838
LoginPage loginPage = homePage.navigateToLoginPage ();

src/test/resources/testdata.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"firstName": "Jason",
55
"lastName": "Langer",
6-
"dob": "17/05/1987",
6+
"dob": "1987-11-19",
77
"street": "11/2, Fort Street",
88
"postalCode": "113445",
99
"city": "California",
@@ -17,7 +17,7 @@
1717
{
1818
"firstName": "Michael",
1919
"lastName": "Justin",
20-
"dob": "23/07/1985",
20+
"dob": "1985-04-23",
2121
"street": "21/4, Dallas Street",
2222
"postalCode": "12976",
2323
"city": "California",
@@ -31,7 +31,7 @@
3131
{
3232
"firstName": "Abraham",
3333
"lastName": "Lord",
34-
"dob": "16/06/1981",
34+
"dob": "1981-08-30",
3535
"street": "30/2, Texas Street",
3636
"postalCode": "155642",
3737
"city": "California",

0 commit comments

Comments
 (0)