Skip to content

Commit 076372c

Browse files
new library, api, db, app added
1 parent e32709b commit 076372c

File tree

124 files changed

+38792
-79
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+38792
-79
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.DS_Store
2+
.idea/
3+
.vscode/
4+
/live-app/fake-api-with-db/node_modules
5+
.classpath/
6+
.project/
7+
.settings/
8+
target/

.idea/uiDesigner.xml

Lines changed: 124 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/zsh
2+
3+
#This allow you to start both server at the same time
4+
TARGET_DIR="$(cd "$(dirname "$0")/live-app/banking-app" && pwd)"
5+
cd "$TARGET_DIR"
6+

JenkinsFiles/Jenkinsfile_listolet_automation

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
pipeline {
2-
agent any
2+
agent {
3+
label {
4+
label ""
5+
customWorkspace "C:\\ProgramData\\Jenkins\\.jenkins\\workspace\\env-ready-listolet"
6+
}
7+
}
38

49
stages {
5-
stage('Build') {
10+
11+
stage('Build and Test') {
612
steps {
7-
dir('C:\ProgramData\Jenkins\.jenkins\workspace\env-ready-listolet') {
8-
bat 'mvn clean test -DsuiteXmlFile=suites/runner.xml'
9-
}
13+
// Change to the project directory and run tests using Maven
14+
bat 'mvn clean test -DsuiteXmlFile=suites/runner.xml'
1015
}
1116
}
1217
stage('Email Report') {
1318
steps {
19+
// Send an email with the test report
1420
emailext (
15-
subject: "Maven Build Report",
21+
subject: "Listolet Test Report",
1622
body: "Please see attached report",
1723
attachmentsPattern: "**/Report/report_.html",
1824

Readme.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# qa_library_selenium (Integrated with API, DB and UI)
2+
3+
qa_library_selenium is a Selenium with Java library for dealing with web app automation
4+
5+
## Installation
6+
7+
Make sure you have following environment
8+
1. NodeJS 16 LTS (https://nodejs.org/en)
9+
2. Java 11 and up (11 is recommend) (https://www.oracle.com/java/technologies/javase/jdk11-archive-downloads.html)
10+
3. Maven (https://maven.apache.org/download.cgi)
11+
4. Docker (https://www.docker.com/)
12+
5. Git (https://git-scm.com/downloads) (For Windows, Mac and Linux run below command)
13+
14+
Linux
15+
```bash
16+
sudo apt-get install git
17+
```
18+
19+
Mac (Make sure that you brew installed)
20+
```bash
21+
brew install git
22+
```
23+
24+
Now, once you checked out this project, you will need to switch to develop branch by running below command
25+
```bash
26+
git checkout develop
27+
```
28+
Once you are in the develop branch, now we need to install all of our pkgs by running bellow command
29+
```bash
30+
mvn clean install
31+
```
32+
Note: It may take a moment.
33+
34+
Once all the pkgs are installed for maven, now we have to navigate to the <live-app/fake-api-with-db> and run below command
35+
```bash
36+
npm install
37+
```
38+
This will install all the required pkgs for the application.
39+
40+
Once All the pkg are installed, now we will need to start our mysql server in docker container, for that navigate to the <live-app/docker-files> and execute below command
41+
```bash
42+
docker-compose -f start_bank_app.yml up -d
43+
```
44+
45+
Once container is up, you should able to access the mysql database using bellow credentials
46+
1. username: root
47+
2. pwd: admin_123
48+
3. Database: qa_db
49+
4. Host: localhost:3306/qa_db
50+
51+
Now we will need to start out App Server, to do that navigate to the <live-app/fake-api-with-db> and run below command
52+
```bash
53+
npm start
54+
```
55+
After running above command you should be able to access the application at https://localhost:8001
56+
57+
Default username and pwd is: johndoe/password
58+
59+
If above steps are too complicated, then follow below steps.
60+
1. cd into <src/test/java/com/qa/server>
61+
2. Right click and Main Function from Start_Server.java
62+
63+
It will automate the whole process
64+
65+
## API
66+
You can api call using below endpoints
67+
68+
baseURI = localhost:8001
69+
1. /users
70+
2. /user/:ID
71+
3. /user/:username
72+
4. /restore-database
73+
74+
Note: GET, DELETE, POST, PUT are supported.
75+
76+
## Execution of existing test cases
77+
I have created simple test cases for this project to make sure that, it is working as expected. You can the default test cases by Navigating to <suites/e2e> and running <e2e_runner>.xml file or You can run below command
78+
```bash
79+
mvn clean test -DsuiteXmlFile=suites/e2e/e2e_runner.xml
80+
```
81+
82+
## Contributing
83+
Feel free to add your ideas and library, if you think something needs to be changed, do so by creating a branch and pull request...
84+
85+
86+
87+
Please make sure to update tests as appropriate in <com/qa/e2e/integration>..
88+
89+
## License
90+
91+
[MIT](https://choosealicense.com/licenses/mit/)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<html><head><title>API Test Report</title></head><body><h1>API Test Report</h1><p>Total Test Cases: 2</p><br/><h2>baseSetup_getToken</h2><p style="color:red;">Test Result: FAILED</p><p>expected [true] but found [false]</p><br/><h2>get_all_list_of_item</h2><p style="color:green;">Test Result: PASSED</p><br/><p>Total Test Cases Executed: 2</p></body></html>

0 commit comments

Comments
 (0)