Added a lot of unit tests
This commit is contained in:
parent
0938fb98b7
commit
16d4a0724c
32 changed files with 4268 additions and 497 deletions
92
tests/data/configuration/clubs.yaml
Normal file
92
tests/data/configuration/clubs.yaml
Normal file
|
@ -0,0 +1,92 @@
|
|||
clubs:
|
||||
- name: Super Club
|
||||
url: https://www.super-club.com
|
||||
id: sc
|
||||
bookingPlatform:
|
||||
id: gestion-sports
|
||||
clubId: 54
|
||||
url: https://superclub.flapi.fr
|
||||
hoursBeforeCancellation: 10
|
||||
bookingOpening:
|
||||
daysBefore: 10
|
||||
time: 22:37
|
||||
totalBookings:
|
||||
peakHours: 3
|
||||
offPeakHours: unlimited
|
||||
sports:
|
||||
- name: Sport1
|
||||
id: 22
|
||||
duration: 55
|
||||
price: 78
|
||||
players: 4
|
||||
courts:
|
||||
- name: Court 1
|
||||
number: 1
|
||||
id: 54
|
||||
isIndoor: True
|
||||
- name: Court 2
|
||||
number: 2
|
||||
id: 67
|
||||
isIndoor: False
|
||||
- name: Court 3
|
||||
number: 3
|
||||
id: 26
|
||||
isIndoor: True
|
||||
- name: Sport2
|
||||
id: 25
|
||||
duration: 22
|
||||
price: 3
|
||||
players: 2
|
||||
courts:
|
||||
- name: Court 1
|
||||
id: 99
|
||||
number: 1
|
||||
isIndoor: True
|
||||
- name: Court 2
|
||||
number: 2
|
||||
id: 101
|
||||
isIndoor: False
|
||||
|
||||
- name: Club Pourri
|
||||
url: https://www.clubpourri.fr
|
||||
id: cp
|
||||
bookingPlatform:
|
||||
id: gestion-sports
|
||||
clubId: 1111
|
||||
url: https://clubpourri.flapi.fr
|
||||
hoursBeforeCancellation: 24
|
||||
bookingOpening:
|
||||
daysBefore: 2
|
||||
time: 02:54
|
||||
totalBookings:
|
||||
peakHours: 4
|
||||
offPeakHours: unlimited
|
||||
sports:
|
||||
- name: Sport1
|
||||
id: 465
|
||||
duration: 44
|
||||
price: 98
|
||||
players: 4
|
||||
courts:
|
||||
- name: Court 7
|
||||
number: 15
|
||||
id: 987
|
||||
isIndoor: True
|
||||
- name: prout prout
|
||||
number: 555
|
||||
id: 747
|
||||
isIndoor: False
|
||||
- name: Sport3
|
||||
id: 321
|
||||
duration: 11
|
||||
price: 18
|
||||
players: 2
|
||||
courts:
|
||||
- name: Court 1
|
||||
id: 613
|
||||
isIndoor: True
|
||||
number: 1
|
||||
- name: Court 2
|
||||
id: 614
|
||||
isIndoor: True
|
||||
number: 2
|
|
@ -0,0 +1 @@
|
|||
ajax=removeResa&hash={{ hash }}&id={{ booking_id }}
|
|
@ -0,0 +1 @@
|
|||
ajax=addResa&date={{ date.date().strftime("%d/%m/%Y") }}&hour={{ date.time().strftime("%H:%M") }}&duration=90&partners=null|null|null&paiement=facultatif&idSport={{ sport_id }}&creaPartie=false&idCourt={{ court_id }}&pay=false&token=undefined&totalPrice=48&saveCard=0&foodNumber=0
|
|
@ -0,0 +1 @@
|
|||
ajax=connexionUser&id_club={{ club.booking_platform.club_id }}&email={{ user.login }}&form_ajax=1&pass={{ user.password }}&compte=user&playeridonesignal=0&identifiant=identifiant&externCo=true
|
12
tests/data/configuration/gestion-sports/post-headers.json
Normal file
12
tests/data/configuration/gestion-sports/post-headers.json
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"Connection": "keep-alive",
|
||||
"Accept-Language": "en-US,en;q=0.5",
|
||||
"Accept-Encoding": "gzip, deflate, br",
|
||||
"DNT": "1",
|
||||
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
"Accept": "application/json, text/javascript, */*; q=0.01",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"Sec-Fetch-Dest": "empty",
|
||||
"Sec-Fetch-Mode": "cors",
|
||||
"Sec-Fetch-Site": "same-origin"
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
ajax=loadResa&hash={{ hash }}
|
19
tests/data/configuration/platforms.yaml
Normal file
19
tests/data/configuration/platforms.yaml
Normal file
|
@ -0,0 +1,19 @@
|
|||
platforms:
|
||||
- name: flapi
|
||||
url: https://flapi.fr/
|
||||
id: gestion-sports
|
||||
urls:
|
||||
- name: landing-page
|
||||
path: /landing.html
|
||||
- name: login
|
||||
path: /login.html
|
||||
payloadTemplate: gestion-sports/login-payload.txt
|
||||
- name: booking
|
||||
path: /booking.html
|
||||
payloadTemplate: gestion-sports/booking-payload.txt
|
||||
- name: user-bookings
|
||||
path: /user_bookings.html
|
||||
payloadTemplate: gestion-sports/user-bookings-payload.txt
|
||||
- name: cancellation
|
||||
path: /cancel.html
|
||||
payloadTemplate: gestion-sports/booking-cancellation-payload.txt
|
13
tests/data/configuration/users.yaml
Normal file
13
tests/data/configuration/users.yaml
Normal file
|
@ -0,0 +1,13 @@
|
|||
clubs:
|
||||
- id: tpc
|
||||
users:
|
||||
- login: padel.testing@jouf.fr
|
||||
password: ridicule
|
||||
- login: mateochal31@gmail.com
|
||||
password: pleanyakis
|
||||
- id: padeltolosa
|
||||
users:
|
||||
- login: padel.testing@jouf.fr
|
||||
password: ridicule
|
||||
- login: mateochal31@gmail.com
|
||||
password: pleanyakis
|
4
tests/data/responses/booking_failure.json
Normal file
4
tests/data/responses/booking_failure.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"status": "error",
|
||||
"message": "D\u00e9sol\u00e9 mais vous avez 1 r\u00e9servation en cours au Padel en heures pleines et le r\u00e9glement n'autorise qu'une r\u00e9servation en heures pleines \u00e0 la fois au Padel!"
|
||||
}
|
5
tests/data/responses/booking_success.json
Normal file
5
tests/data/responses/booking_success.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"status": "ok",
|
||||
"message": "Merci, votre r\u00e9servation s'est bien effectu\u00e9e, vous allez recevoir un email avec le r\u00e9capitulatif de votre r\u00e9servation, pensez \u00e0 le conserver.",
|
||||
"id_resa": 3609529
|
||||
}
|
4
tests/data/responses/cancellation_response.json
Normal file
4
tests/data/responses/cancellation_response.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"status": "ok",
|
||||
"message": "La r\u00e9servation a bien \u00e9t\u00e9 annul\u00e9e !"
|
||||
}
|
2033
tests/data/responses/landing_response.html
Normal file
2033
tests/data/responses/landing_response.html
Normal file
File diff suppressed because it is too large
Load diff
5
tests/data/responses/login_failure.json
Normal file
5
tests/data/responses/login_failure.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"status": "ko",
|
||||
"msg": "L'email ou le mot de passe saisi est incorrect.",
|
||||
"data": false
|
||||
}
|
9
tests/data/responses/login_success.json
Normal file
9
tests/data/responses/login_success.json
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"status": "ok",
|
||||
"msg": "",
|
||||
"data": {
|
||||
"needChoice": false,
|
||||
"redirectUrl": "\/membre",
|
||||
"id_club": 88
|
||||
}
|
||||
}
|
1363
tests/data/responses/user_bookings_get.html
Normal file
1363
tests/data/responses/user_bookings_get.html
Normal file
File diff suppressed because one or more lines are too long
52
tests/data/responses/user_bookings_post.json
Normal file
52
tests/data/responses/user_bookings_post.json
Normal file
|
@ -0,0 +1,52 @@
|
|||
[
|
||||
{
|
||||
"id": 111,
|
||||
"chargeId": null,
|
||||
"partners": [],
|
||||
"dateResa": "21\/03\/2024",
|
||||
"startTime": "13:30",
|
||||
"endTime": "15:00",
|
||||
"dayFr": "jeudi 21 mars 2024",
|
||||
"codeLiveXperience": null,
|
||||
"qrCodeSpartime": null,
|
||||
"sport": "Sport1",
|
||||
"court": "court 13",
|
||||
"creaPartie": 0,
|
||||
"limitCreaPartie": "2024-03-21 11:30:00",
|
||||
"cancel": true,
|
||||
"bloquerRemplacementJoueur": 1,
|
||||
"canRemovePartners": false,
|
||||
"remainingPlaces": 3,
|
||||
"isCaptain": true,
|
||||
"dtStart": "2024-03-21T13:30:00+01:00",
|
||||
"garantieCb": null,
|
||||
"dureeValidCertif": null,
|
||||
"playerStatus": 3,
|
||||
"products": []
|
||||
},
|
||||
{
|
||||
"id": 360,
|
||||
"chargeId": null,
|
||||
"partners": [],
|
||||
"dateResa": "18\/11\/2025",
|
||||
"startTime": "09:00",
|
||||
"endTime": "10:30",
|
||||
"dayFr": "vendredi 18 novembre 2025",
|
||||
"codeLiveXperience": null,
|
||||
"qrCodeSpartime": null,
|
||||
"sport": "Sport1",
|
||||
"court": "court 13",
|
||||
"creaPartie": 0,
|
||||
"limitCreaPartie": "2025-11-18 07:00:00",
|
||||
"cancel": true,
|
||||
"bloquerRemplacementJoueur": 1,
|
||||
"canRemovePartners": false,
|
||||
"remainingPlaces": 3,
|
||||
"isCaptain": true,
|
||||
"dtStart": "2025-11-18T07:00:00+01:00",
|
||||
"garantieCb": null,
|
||||
"dureeValidCertif": null,
|
||||
"playerStatus": 3,
|
||||
"products": []
|
||||
}
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue