Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add_UI_Test/Cypress/Basic_tests #190

Open
wants to merge 42 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
2d1f05d
cypress-base
Jan 16, 2021
fd0a9bb
cypress-build
Jan 16, 2021
8a14390
cypress-build
Jan 16, 2021
8583d31
cypress-build
Jan 16, 2021
2f61089
readme
Jan 17, 2021
219ad38
Merge branch 'main' of https://github.com/PythonFreeCourse/calendar i…
Jan 18, 2021
89aaeec
pull from dev
Jan 19, 2021
0b9bed3
merge changes
Jan 20, 2021
d1e4cfe
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
Jan 20, 2021
77d135e
profile page tests
Jan 20, 2021
25aa774
Merge pull request #1 from PythonFreeCourse/develop
Lisafiluz Jan 20, 2021
b9a5bfb
delete-user
Jan 20, 2021
30b8975
delete_all_events_of_the_user
Jan 22, 2021
7f9e405
Merge pull request #2 from Lisafiluz/delete-user
Lisafiluz Jan 22, 2021
d1217d6
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
Jan 22, 2021
34b2bf4
delete-user\add-confirmation
Jan 22, 2021
fb5aa93
Merge pull request #3 from Lisafiluz/delete-user
Lisafiluz Jan 22, 2021
ba9838d
delete-user/fix_comments
Jan 22, 2021
cdeddaf
Merge pull request #4 from Lisafiluz/delete-user
Lisafiluz Jan 22, 2021
695f0d6
Merge pull request #5 from PythonFreeCourse/develop
Lisafiluz Jan 23, 2021
8b8a5ac
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
Feb 1, 2021
9d5c5c8
update readme
Feb 1, 2021
bdac43f
Merge branch 'develop' of https://github.com/Lisafiluz/calendar into …
Feb 1, 2021
fd405a0
Merge pull request #8 from Lisafiluz/add-cypress
Lisafiluz Feb 1, 2021
281ab2c
add git idnore
Feb 2, 2021
1e833d7
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
Feb 2, 2021
bb2e36e
Delete tests/tests-ui/node_modules directory
Lisafiluz Feb 2, 2021
ae1486d
Merge branch 'develop' of https://github.com/Lisafiluz/calendar into …
Feb 2, 2021
8fc8c42
add_cypress_basic_templates
Feb 2, 2021
fdfd5bc
Merge pull request #10 from Lisafiluz/add-cypress
Lisafiluz Feb 2, 2021
4c0d3b8
Update database.py
Lisafiluz Feb 2, 2021
41c62a7
Update profile.py
Lisafiluz Feb 2, 2021
e07816c
Update test_profile.py
Lisafiluz Feb 2, 2021
602a5f3
Merge branch 'develop' into develop
Lisafiluz Feb 3, 2021
4d751bc
Merge branch 'develop' into develop
Lisafiluz Feb 4, 2021
f3aeb5d
Update cy_HomePage_Resolution.js
Lisafiluz Feb 4, 2021
1b5b1fe
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
Feb 23, 2021
c7568d6
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
Feb 23, 2021
fb10553
conflicts_fix
Feb 23, 2021
cc9b06e
Merge branch 'develop' of https://github.com/Lisafiluz/calendar into …
Feb 23, 2021
e3a9bc4
Merge branch 'develop' into add-cypress
Lisafiluz Feb 23, 2021
b8cd8d3
Merge pull request #12 from Lisafiluz/add-cypress
Lisafiluz Feb 23, 2021
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,10 @@ dmypy.json
.vscode/
app/.vscode/

app/routers/stam

# Cypress
tests/tests-ui/node_modules/

# PyCharm
.idea
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,26 @@ cp app/config.py.example app/configuration.py
# Edit the variables' values.
uvicorn app.main:app --reload
```

### Cypress:
Front end testing tool.

Every test created with testLevel configuration, the defualt level we run our test is 5.
Basic tests will spicified with lower testLevel than advanced tests.

#To run Cypress:
Lisafiluz marked this conversation as resolved.
Show resolved Hide resolved

1. Make sure you already installed npm (run npm --version to check).
2. Run the server
3. Nevigate to 'test-ui' folder: calendar/tests/test-ui
- Run with Test Runner:
1. Run on terminal: ```npx cypress open```
2. Test Runner will open: choose test and click it to execute
- Run all test without watching:
1. Run on terminal: ```npx cypress run```
- Run a specific test file without watching:
1. Run on terminal: ```npx cypress run --spec cypress/integration/path/to/file```
- Run tests with change level env config to 10: ```npx cypress run --env level=10```
### Running tests
```shell
python -m pytest --cov-report term-missing --cov=app tests
Expand Down
1 change: 1 addition & 0 deletions app/database/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import Session, sessionmaker


from app import config


Expand Down
3 changes: 3 additions & 0 deletions app/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,7 @@ body {
.profile-modal-header {
border: none;
background-color:whitesmoke;
}
.btn-danger {
margin: auto;
}
8 changes: 3 additions & 5 deletions app/templates/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ <h5 class="modal-title">Update Full Name</h5>
<button type="submit" class="btn btn-sm btn-success">Save changes</button>
</div>
</form>
</div>

</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -110,7 +109,6 @@ <h5 class="modal-title">About me</h5>
</div>
</form>
</div>

</div>
</div>
</div>
Expand Down Expand Up @@ -169,7 +167,7 @@ <h5 class="modal-title">My Telegram Id</h5>
<img class="card-img-top profile-image rounded-circle mx-auto d-block"
src="{{ url_for('media', path=user.avatar) }}" alt="Profile image">
<div class="card-body">
<h6 class="card-title text-center mb-1">{{ user.full_name }}</h6>
<h6 class="card-title text-center mb-1" id="user_fullName">{{ user.full_name }}</h6>
<p class="card-text text-center mt-0">
<a class="nav-link text-secondary" href="#">
<i class="fa fa-spin fa-cog" aria-hidden="true"></i>
Expand All @@ -178,7 +176,7 @@ <h6 class="card-title text-center mb-1">{{ user.full_name }}</h6>
</p>
<hr>
<p class="card-text text-center">
<small>
<small id="description">
{{ user.description }}
</small>
</p>
Expand Down
16 changes: 16 additions & 0 deletions schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,23 @@
├── requirements.txt
├── schema.md
└── tests
└── tests_ui
├──cypress
├──enums
├──fixtures
├──integration
├──plugins
├──screenshots
├──support
└──videos
├──node_modules
├──cypress.json
├──package-lock.json
└──package.json
├── __init__.py
└── conftest.py
└── test_profile.py
└── test_app.py
├── conftest.py
├── test_agenda_internal.py
├── test_agenda_route.py
Expand Down
15 changes: 15 additions & 0 deletions tests/tests-ui/cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"baseUrl": "http://localhost:8000",
"viewportWidth": 1920,
"viewportHeight": 1080,
"pageLoadTimeout": 30000,
"requestTimeout": 10000,
"responseTimeout": 35000,
"defaultCommandTimeout": 20000,
"retries": 1,
"env": {
"user": "_user_qa",
"password": "TheBestPassword123",
"level": 1
}
}
5 changes: 5 additions & 0 deletions tests/tests-ui/cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "[email protected]",
"body": "Fixtures are a great way to mock data for responses to routes"
}
5 changes: 5 additions & 0 deletions tests/tests-ui/cypress/fixtures/profile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"id": 8739,
"name": "Jane",
"email": "[email protected]"
}
232 changes: 232 additions & 0 deletions tests/tests-ui/cypress/fixtures/users.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
[
{
"id": 1,
"name": "Leanne Graham",
"username": "Bret",
"email": "[email protected]",
"address": {
"street": "Kulas Light",
"suite": "Apt. 556",
"city": "Gwenborough",
"zipcode": "92998-3874",
"geo": {
"lat": "-37.3159",
"lng": "81.1496"
}
},
"phone": "1-770-736-8031 x56442",
"website": "hildegard.org",
"company": {
"name": "Romaguera-Crona",
"catchPhrase": "Multi-layered client-server neural-net",
"bs": "harness real-time e-markets"
}
},
{
"id": 2,
"name": "Ervin Howell",
"username": "Antonette",
"email": "[email protected]",
"address": {
"street": "Victor Plains",
"suite": "Suite 879",
"city": "Wisokyburgh",
"zipcode": "90566-7771",
"geo": {
"lat": "-43.9509",
"lng": "-34.4618"
}
},
"phone": "010-692-6593 x09125",
"website": "anastasia.net",
"company": {
"name": "Deckow-Crist",
"catchPhrase": "Proactive didactic contingency",
"bs": "synergize scalable supply-chains"
}
},
{
"id": 3,
"name": "Clementine Bauch",
"username": "Samantha",
"email": "[email protected]",
"address": {
"street": "Douglas Extension",
"suite": "Suite 847",
"city": "McKenziehaven",
"zipcode": "59590-4157",
"geo": {
"lat": "-68.6102",
"lng": "-47.0653"
}
},
"phone": "1-463-123-4447",
"website": "ramiro.info",
"company": {
"name": "Romaguera-Jacobson",
"catchPhrase": "Face to face bifurcated interface",
"bs": "e-enable strategic applications"
}
},
{
"id": 4,
"name": "Patricia Lebsack",
"username": "Karianne",
"email": "[email protected]",
"address": {
"street": "Hoeger Mall",
"suite": "Apt. 692",
"city": "South Elvis",
"zipcode": "53919-4257",
"geo": {
"lat": "29.4572",
"lng": "-164.2990"
}
},
"phone": "493-170-9623 x156",
"website": "kale.biz",
"company": {
"name": "Robel-Corkery",
"catchPhrase": "Multi-tiered zero tolerance productivity",
"bs": "transition cutting-edge web services"
}
},
{
"id": 5,
"name": "Chelsey Dietrich",
"username": "Kamren",
"email": "[email protected]",
"address": {
"street": "Skiles Walks",
"suite": "Suite 351",
"city": "Roscoeview",
"zipcode": "33263",
"geo": {
"lat": "-31.8129",
"lng": "62.5342"
}
},
"phone": "(254)954-1289",
"website": "demarco.info",
"company": {
"name": "Keebler LLC",
"catchPhrase": "User-centric fault-tolerant solution",
"bs": "revolutionize end-to-end systems"
}
},
{
"id": 6,
"name": "Mrs. Dennis Schulist",
"username": "Leopoldo_Corkery",
"email": "[email protected]",
"address": {
"street": "Norberto Crossing",
"suite": "Apt. 950",
"city": "South Christy",
"zipcode": "23505-1337",
"geo": {
"lat": "-71.4197",
"lng": "71.7478"
}
},
"phone": "1-477-935-8478 x6430",
"website": "ola.org",
"company": {
"name": "Considine-Lockman",
"catchPhrase": "Synchronised bottom-line interface",
"bs": "e-enable innovative applications"
}
},
{
"id": 7,
"name": "Kurtis Weissnat",
"username": "Elwyn.Skiles",
"email": "[email protected]",
"address": {
"street": "Rex Trail",
"suite": "Suite 280",
"city": "Howemouth",
"zipcode": "58804-1099",
"geo": {
"lat": "24.8918",
"lng": "21.8984"
}
},
"phone": "210.067.6132",
"website": "elvis.io",
"company": {
"name": "Johns Group",
"catchPhrase": "Configurable multimedia task-force",
"bs": "generate enterprise e-tailers"
}
},
{
"id": 8,
"name": "Nicholas Runolfsdottir V",
"username": "Maxime_Nienow",
"email": "[email protected]",
"address": {
"street": "Ellsworth Summit",
"suite": "Suite 729",
"city": "Aliyaview",
"zipcode": "45169",
"geo": {
"lat": "-14.3990",
"lng": "-120.7677"
}
},
"phone": "586.493.6943 x140",
"website": "jacynthe.com",
"company": {
"name": "Abernathy Group",
"catchPhrase": "Implemented secondary concept",
"bs": "e-enable extensible e-tailers"
}
},
{
"id": 9,
"name": "Glenna Reichert",
"username": "Delphine",
"email": "[email protected]",
"address": {
"street": "Dayna Park",
"suite": "Suite 449",
"city": "Bartholomebury",
"zipcode": "76495-3109",
"geo": {
"lat": "24.6463",
"lng": "-168.8889"
}
},
"phone": "(775)976-6794 x41206",
"website": "conrad.com",
"company": {
"name": "Yost and Sons",
"catchPhrase": "Switchable contextually-based project",
"bs": "aggregate real-time technologies"
}
},
{
"id": 10,
"name": "Clementina DuBuque",
"username": "Moriah.Stanton",
"email": "[email protected]",
"address": {
"street": "Kattie Turnpike",
"suite": "Suite 198",
"city": "Lebsackbury",
"zipcode": "31428-2261",
"geo": {
"lat": "-38.2386",
"lng": "57.2232"
}
},
"phone": "024-648-3804",
"website": "ambrose.net",
"company": {
"name": "Hoeger LLC",
"catchPhrase": "Centralized empowering task-force",
"bs": "target end-to-end models"
}
}
]
Loading