-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* A user can register herself * A registered user can connect to the platform * A connected user can create a diary
- Loading branch information
1 parent
985ab04
commit 54b5420
Showing
8 changed files
with
169 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#language : fr | ||
|
||
Fonctionnalité: Créer un journal | ||
|
||
Scénario: créer un journal | ||
|
||
Soit l'analyste est identifié | ||
Quand l'analyste crée un journal | ||
Alors le journal "essai " est créé |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#language: fr | ||
|
||
Fonctionnalité: Entrer | ||
|
||
Scénario: à partir de la page d'accueil | ||
|
||
Soit un navigateur sur la page d'accueil | ||
Quand l'analyste clique sur "Journal pour l'analyse qualitative" | ||
Alors le titre "Journaux de bord" est affiché | ||
Et le bouton "S'identifier" est affiché | ||
Et le bouton "Créer un compte" est affiché | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
Soit("un navigateur sur la page d'accueil") do | ||
visit "/" | ||
end | ||
|
||
Soit("la page des journaux de bord") do | ||
visit "/memo/" | ||
end | ||
|
||
Soit("l'analyste est identifié") do | ||
visit "/memo/" | ||
click_on "S'identifier" | ||
expect(page).to have_content("S'identifier") | ||
fill_in placeholder: 'Identifiant', with: "[email protected]" | ||
fill_in placeholder: 'Mot de passe', with: "Ep0nge" | ||
click_on "S'identifier" | ||
expect(page).to have_content "Se déconnecter" | ||
end | ||
|
||
Soit("une page comportant le bouton {string}") do |btn| | ||
expect(page).to have_content btn | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
Quand("l'analyste entre") do | ||
visit "/memo/" | ||
end | ||
|
||
Quand("l'analyste clique sur {string}") do |lien| | ||
click_on lien | ||
end | ||
|
||
Quand("l'analyste souhaite s'identifier en tant que {string} avec le mot de passe {string}") do |login, password| | ||
click_on "S'identifier" | ||
expect(page).to have_content("S'identifier") | ||
fill_in placeholder: 'Identifiant', with: login | ||
fill_in placeholder: 'Mot de passe', with: password | ||
click_on "S'identifier" | ||
end | ||
|
||
Quand("{string} souhaite créer un compte en tant que {string} avec le mot de passe {string}") do |fullname, login, password| | ||
click_on "Créer un compte" | ||
expect(page).to have_content("Je ne fais pas partie de l'université de Liège") | ||
find("#newaccount").click | ||
expect(page).to have_content("Nom complet (prénom et nom de famille)") | ||
range = [*'0'..'9',*'A'..'F'] | ||
hash = Array.new(36){ range.sample }.join | ||
fill_in placeholder: 'Jack London', with: 'test'+ hash + fullname | ||
fill_in placeholder: '[email protected]', with: login + hash | ||
fill_in "password", with: password | ||
fill_in "confirm", with: password | ||
click_on "Créer un compte" | ||
click_on "Journaux de bord" | ||
end | ||
|
||
|
||
Quand("l'analyste crée un journal") do | ||
visit "/memo/" | ||
numbers = [*'0'..'9'] | ||
cardinal = Array.new(3){ numbers.sample }.join | ||
today_date = Date.today.strftime('%Y-%m-%d') | ||
diary_name = 'essai ' + today_date + cardinal | ||
fill_in placeholder: 'Mon journal de bord', with: diary_name | ||
click_on "Créer..." | ||
click_on "Enregistrer" | ||
expect(page).to have_content("Ajouter un ancrage") | ||
visit "/memo/" | ||
expect(page).to have_content(diary_name) | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Alors ("le bouton {string} est affiché") do |btn| | ||
expect(page).to have_content btn | ||
end | ||
|
||
Alors ("le titre {string} est affiché") do |title| | ||
expect(page).to have_content title | ||
end | ||
|
||
|
||
Alors("{string} est connecté") do |fullname| | ||
expect(page).to have_content fullname | ||
expect(page).to have_content "Se déconnecter" | ||
end | ||
|
||
Alors("l'analyste n'est pas connecté") do | ||
expect(page).to have_content "S'identifier" | ||
end | ||
|
||
Alors("le journal {string} est créé") do |diary_name| | ||
new_diary_name = "tentative réussie du "+ Date.today.strftime('%Y-%m-%d') | ||
visit "/memo/" | ||
click_on diary_name+Date.today.strftime('%Y-%m-%d') | ||
page.find("h1").click | ||
fill_in 'name', with: new_diary_name | ||
click_on "Enregistrer" | ||
visit "/memo/" | ||
expect(page).to have_content(new_diary_name) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require 'capybara/cucumber' | ||
require 'capybara/cuprite' | ||
|
||
Before do | ||
Capybara.current_session.driver.add_headers("Accept-Language" => "fr") | ||
end | ||
Capybara.run_server = false | ||
Capybara.default_driver = :cuprite | ||
Capybara.javascript_driver = :cuprite | ||
Capybara.app_host = ENV["APP_HOST"] || "http://localhost:3000" | ||
Capybara.default_max_wait_time = 10 | ||
Capybara.register_driver(:cuprite) do |app| | ||
Capybara::Cuprite::Driver.new(app, | ||
browser_options: { 'no-sandbox': nil }, | ||
timeout: 30 | ||
) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#language : fr | ||
|
||
Fonctionnalité: S'identifier | ||
|
||
Scénario: avec un mot de passe correct | ||
|
||
Soit la page des journaux de bord | ||
Quand l'analyste souhaite s'identifier en tant que "[email protected]" avec le mot de passe "Ep0nge" | ||
Alors "Robert Testeur" est connecté | ||
Et le bouton "Créer..." est affiché | ||
|
||
Scénario: avec un mot de passe erroné | ||
|
||
Soit la page des journaux de bord | ||
Quand l'analyste souhaite s'identifier en tant que "[email protected]" avec le mot de passe "Eponge" | ||
Alors l'analyste n'est pas connecté |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#language : fr | ||
|
||
Fonctionnalité: Créer un compte | ||
|
||
Scénario: se rendre au bon endroit | ||
|
||
Soit la page des journaux de bord | ||
Quand l'analyste clique sur "Créer un compte" | ||
Alors le titre "Créer un compte" est affiché | ||
Et le bouton "Je fais partie de l'université de Liège" est affiché | ||
Et le bouton "Je ne fais pas partie de l'université de Liège" est affiché | ||
|
||
Scénario: créer un compte | ||
|
||
Soit la page des journaux de bord | ||
Quand "Robert Testeur" souhaite créer un compte en tant que "bob" avec le mot de passe "bricoleur" | ||
Alors "Robert Testeur" est connecté | ||
|