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

Vacation task #45

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 18 additions & 0 deletions spec/features/Add_UV
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'spec_helper'

feature 'Add UV' do

$corpus = a_string

scenario 'for create a new corpus' do
visit $home_page
click_on 'Se connecter'
log_in_as 'alice', 'lapinblanc'
toggle_edit
click_plus_sign_next_to 'Corpus'
click_last 'Corpus'
type $corpus, : return
expect(page).to have_content($corpus)
end

end
25 changes: 25 additions & 0 deletions spec/features/Research_by_attribute
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
feature 'Research by attribute' do

scenario 'for search UV by responsible' do
visit '/'
click_on 'Rechercher par attributs'
select 'UV', :from => 'Corpus'
select 'Responsable', :from => 'Nom'
select 'Marc Lemercier', :from => 'Valeur'
click_on 'Rechercher'
click_on 'NF19...'
end

scenario 'for search UV by two intervenants' do
visit '/'
click_on 'Rechercher par attributs'
select 'UV', :from => 'Corpus'
select 'Intervenant', :from => 'Nom'
select 'Ines Di Loreto', :from => 'Valeur'
click_on '+'
select 'Intervenant', :from => 'Nom'
select 'Pascal Salembier', :from => 'Valeur'
click_on 'Rechercher'
click_on 'IF10...'
end
end
35 changes: 14 additions & 21 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,45 +1,38 @@
require 'capybara/rspec'
require 'capybara/poltergeist'
require 'capybara/webkit'

Capybara.run_server = false
Capybara.default_driver = :poltergeist
Capybara.app_host = "http://agorae.test.hypertopic.org"
Capybara.default_driver = :webkit
Capybara.default_wait_time = 5
Capybara.app_host ='http://agorae.test.hypertopic.org/#http://agorae.test.hypertopic.org/argos/item/cd48c7fdc83cb4ab1a61f574a631d4ec/5329d9bc4c34fd2ef8ccb896004e0a0a'

$home_page = '/'

def in_dialog()
find('#dialog')
end

def log_in_as(login, password)
fill_in "Nom d'utilisateur", :with => login
fill_in 'Mot de passe', :with => password
in_dialog.click_on 'Se connecter'
expect(page).not_to have_content 'Connectez-vous'
end

def type(*keys_sequences)
keys_sequences.each do |s|
find('input[type=textbox]').native.send_keys s
end
end

def toggle_edit()
find('#toggle').click
end

def a_string()
s = ('a'..'z').to_a.shuffle[0,8].join
end

def click_plus_sign_next_to(list)
find(".#{list}-list .add").click
end

def click_last(list)
find("##{list} li:last-child .editable").click
end

def click_on_link(text)
find('span', :text => "#{text}").click
end

def type(*keys_sequences)
keys_sequences.each do |s|
find('input[type=textbox]').native.send_keys s
end
end

def a_string()
s = ('a'..'z').to_a.shuffle[0,8].join
end