mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-07 13:44:23 +08:00
WIP - click button helpers
This commit is contained in:
parent
1572a9eb28
commit
a632f10759
7 changed files with 204 additions and 131 deletions
1
Gemfile
1
Gemfile
|
@ -131,6 +131,7 @@ end
|
|||
group :test do
|
||||
gem 'capybara'
|
||||
gem 'capybara-email'
|
||||
gem 'chromedriver-helper'
|
||||
gem 'cucumber-rails', '~> 1.8', require: false
|
||||
gem 'database_cleaner'
|
||||
gem 'json_matchers'
|
||||
|
|
|
@ -109,6 +109,8 @@ GEM
|
|||
aes_key_wrap (1.0.1)
|
||||
ajax-datatables-rails (0.3.1)
|
||||
railties (>= 3.1)
|
||||
archive-zip (0.12.0)
|
||||
io-like (~> 0.3.0)
|
||||
aspector (0.14.0)
|
||||
ast (2.4.0)
|
||||
auto_strip_attributes (2.5.0)
|
||||
|
@ -186,6 +188,9 @@ GEM
|
|||
activesupport
|
||||
childprocess (1.0.1)
|
||||
rake (< 13.0)
|
||||
chromedriver-helper (2.1.1)
|
||||
archive-zip (~> 0.10)
|
||||
nokogiri (~> 1.8)
|
||||
coderay (1.1.2)
|
||||
coffee-rails (5.0.0)
|
||||
coffee-script (>= 2.2.0)
|
||||
|
@ -287,6 +292,7 @@ GEM
|
|||
mini_magick (>= 4.9.5, < 5)
|
||||
ruby-vips (>= 2.0.13, < 3)
|
||||
iniparse (1.4.4)
|
||||
io-like (0.3.1)
|
||||
jaro_winkler (1.5.4)
|
||||
jbuilder (2.9.1)
|
||||
activesupport (>= 4.2.0)
|
||||
|
@ -614,6 +620,7 @@ DEPENDENCIES
|
|||
capybara
|
||||
capybara-email
|
||||
caracal-rails
|
||||
chromedriver-helper
|
||||
commit_param_routing
|
||||
cucumber-rails (~> 1.8)
|
||||
database_cleaner
|
||||
|
|
|
@ -14,53 +14,53 @@ Background:
|
|||
And "nonadmin@myorg.com" is in "BioSistemika Process" team as a "admin"
|
||||
Given Demo project exists for the "BioSistemika Process" team
|
||||
And "nonadmin@myorg.com" is signed in with "mypassword1234"
|
||||
|
||||
|
||||
@javascript
|
||||
Scenario: Unsuccessful add Text result
|
||||
Given I am on Task results page
|
||||
And I click on "Text" button
|
||||
And I click on "save-result" class button
|
||||
And I click "Text" button
|
||||
And I click "Add" button
|
||||
Then I should see "can't be blank"
|
||||
And I click on "Cancel" button
|
||||
And I click "Cancel" button
|
||||
|
||||
@javascript
|
||||
Scenario: Successful add text result with Text name
|
||||
Given I am on Task results page
|
||||
And I click on "Text" button
|
||||
And I click "Text" button
|
||||
And I fill in "LJ ZOO" in "#result_name" field
|
||||
And I fill in "Živali pa so se odpravile dalje po svetu." in "#result_text_attributes_textarea" rich text editor field
|
||||
And I click on "save-result" class button
|
||||
And I click "Add" button
|
||||
Then I should see "LJ ZOO"
|
||||
|
||||
@javascript
|
||||
Scenario: Successful add Text result
|
||||
Given I am on Task results page
|
||||
And I click on "Text" button
|
||||
And I click "Text" button
|
||||
And I fill in "Vse to pa zaradi botra petelina, bog mu daj zdravje!" in "#result_text_attributes_textarea" rich text editor field
|
||||
And I click on "save-result" class button
|
||||
And I click "Add" button
|
||||
Then I should see "Vse to pa zaradi botra petelina, bog mu daj zdravje!"
|
||||
|
||||
@javascript
|
||||
Scenario: Successful edit Text task result
|
||||
Given I am on Task results page
|
||||
And I click on "Text" button
|
||||
And I click "Text" button
|
||||
And I fill in "LJ ZOO" in "#result_name" field
|
||||
And I fill in "Živali pa so se odpravile dalje po svetu." in "#result_text_attributes_textarea" rich text editor field
|
||||
And I click on "save-result" class button
|
||||
And I click on ".fa-pencil-alt" sign
|
||||
And I click "Add" button
|
||||
And I click "fa-pencil-alt" SCIicon
|
||||
And I fill in "ZOO" in "#result_name" field
|
||||
And I fill in "Vse to pa zaradi botra petelina!" in "#result_text_attributes_textarea" rich text editor field
|
||||
And I click on "save-result" class button
|
||||
And I click "Save" button
|
||||
Then I should see "Vse to pa zaradi botra petelina!"
|
||||
|
||||
@javascript
|
||||
Scenario: Successful add comment to a Text task result
|
||||
Given I am on Task results page
|
||||
And I click on "Text" button
|
||||
And I click "Text" button
|
||||
And I fill in "LJ ZOO" in "#result_name" field
|
||||
And I fill in "Živali pa so se odpravile dalje po svetu." in "#result_text_attributes_textarea" rich text editor field
|
||||
And I click on "save-result" class button
|
||||
And I click on ".result-panel-collapse-link" sign
|
||||
And I click "Add" button
|
||||
And I click ".result-panel-collapse-link" sign
|
||||
And I fill in "I was on Triglav one summer." in "message" textarea field
|
||||
And I click on "i.fas:nth-child(2)" sign
|
||||
And WAIT
|
||||
|
@ -69,10 +69,10 @@ Scenario: Successful add comment to a Text task result
|
|||
@javascript
|
||||
Scenario: Unsuccessful add comment to a Text task result
|
||||
Given I am on Task results page
|
||||
And I click on "Text" button
|
||||
And I click "Text" button
|
||||
And I fill in "LJ ZOO" in "#result_name" field
|
||||
And I fill in "Živali pa so se odpravile dalje po svetu." in "#result_text_attributes_textarea" rich text editor field
|
||||
And I click on "save-result" class button
|
||||
And I click "Add" button
|
||||
And I click on ".result-panel-collapse-link" sign
|
||||
And I fill in "" in "message" textarea field
|
||||
And confirm with ENTER key to "#message"
|
||||
|
@ -83,42 +83,42 @@ Scenario: Unsuccessful add comment to a Text task result
|
|||
@javascript
|
||||
Scenario: Successful edit comment to a Text task result
|
||||
Given I am on Task results page
|
||||
And I click on "Text" button
|
||||
And I click "Text" button
|
||||
And I fill in "LJ ZOO" in "#result_name" field
|
||||
And I fill in "Živali pa so se odpravile dalje po svetu." in "#result_text_attributes_textarea" rich text editor field
|
||||
And I click on "save-result" class button
|
||||
And I click "Add" button
|
||||
And I click on ".result-panel-collapse-link" sign
|
||||
And I fill in "I was on Triglav one summer." in "message" textarea field
|
||||
And I click on "i.fas:nth-child(2)" sign
|
||||
And WAIT
|
||||
And I click on ".comment-container" sign
|
||||
And I change comment "I was on Triglav one summer." with "I was on Triglav one summer and I do not have plans to go once more." of "#message"
|
||||
And I change comment "I was on Triglav one summer." with "I was on Triglav one summer and I do not have plans to go once more." of "#message"
|
||||
And I click on ".save-button" sign
|
||||
Then I should see "I was on Triglav one summer and I do not have plans to go once more."
|
||||
|
||||
@javascript
|
||||
Scenario: Unsuccessful edit comment to a Text task result
|
||||
Given I am on Task results page
|
||||
And I click on "Text" button
|
||||
And I click "Text" button
|
||||
And I fill in "LJ ZOO" in "#result_name" field
|
||||
And I fill in "Živali pa so se odpravile dalje po svetu." in "#result_text_attributes_textarea" rich text editor field
|
||||
And I click on "save-result" class button
|
||||
And I click "Add" button
|
||||
And I click on ".result-panel-collapse-link" sign
|
||||
And I fill in "I was on Triglav one summer." in "message" textarea field
|
||||
And I click on "i.fas:nth-child(2)" sign
|
||||
And WAIT
|
||||
And I click on ".comment-container" sign
|
||||
And I change comment "I was on Triglav one summer." with "I was on Triglav one summer and I do not have plans to go once more." of "#message"
|
||||
And I change comment "I was on Triglav one summer." with "I was on Triglav one summer and I do not have plans to go once more." of "#message"
|
||||
And I click on ".cancel-button" sign
|
||||
Then I should see "I was on Triglav one summer."
|
||||
|
||||
@javascript
|
||||
Scenario: Unsuccessful delete comment to a Text task resultGiven I am on Task results page
|
||||
Given I am on Task results page
|
||||
And I click on "Text" button
|
||||
And I click "Text" button
|
||||
And I fill in "LJ ZOO" in "#result_name" field
|
||||
And I fill in "Živali pa so se odpravile dalje po svetu." in "#result_text_attributes_textarea" rich text editor field
|
||||
And I click on "save-result" class button
|
||||
And I click "Add" button
|
||||
And I click on ".result-panel-collapse-link" sign
|
||||
And I fill in "I was on Triglav one summer." in "message" textarea field
|
||||
And I click on "i.fas:nth-child(2)" sign
|
||||
|
@ -131,10 +131,10 @@ Scenario: Unsuccessful delete comment to a Text task resultGiven I am on Task re
|
|||
@javascript
|
||||
Scenario: Successful delete comment to a Text task result
|
||||
Given I am on Task results page
|
||||
And I click on "Text" button
|
||||
And I click "Text" button
|
||||
And I fill in "LJ ZOO" in "#result_name" field
|
||||
And I fill in "Živali pa so se odpravile dalje po svetu." in "#result_text_attributes_textarea" rich text editor field
|
||||
And I click on "save-result" class button
|
||||
And I click "Add" button
|
||||
And I click on ".result-panel-collapse-link" sign
|
||||
And I fill in "I was on Triglav one summer." in "message" textarea field
|
||||
And I click on "i.fas:nth-child(2)" sign
|
||||
|
@ -148,61 +148,61 @@ Scenario: Successful delete comment to a Text task result
|
|||
@javascript
|
||||
Scenario: Successful archive text result with Text name
|
||||
Given I am on Task results page
|
||||
And I click on "Text" button
|
||||
And I click "Text" button
|
||||
And I fill in "LJ ZOO" in "#result_name" field
|
||||
And I fill in "Živali pa so se odpravile dalje po svetu." in "#result_text_attributes_textarea" rich text editor field
|
||||
And I click on "save-result" class button
|
||||
And I click on "form-submit-link" class button
|
||||
And I click "Add" button
|
||||
And I click "fa-briefcase" SCIicon
|
||||
And I click to OK on confirm dialog
|
||||
Then I should see "Successfully archived text result in task Experiment design" flash message
|
||||
|
||||
@wip
|
||||
Scenario: Unsuccessful add Table result ##########this one doesnt work
|
||||
Given I am on Task results page
|
||||
And I click on "Table" button
|
||||
And I click on "save-result" class button
|
||||
And I click "Table" button
|
||||
And I click "Add" button
|
||||
Then I should see "can't be blank"
|
||||
And I click on "Cancel" button
|
||||
And I click "Cancel" button
|
||||
|
||||
@javascript
|
||||
Scenario: Successful add table result with Table name
|
||||
Given I am on Task results page
|
||||
And I click on "Table" button
|
||||
And I click "Table" button
|
||||
And I fill in "ZOO" in "#result_name" field
|
||||
And I click on table cell one
|
||||
And I input "Živali pa so se odpravile dalje po svetu." in cell
|
||||
And I click on "save-result" class button
|
||||
And I input "Živali pa so se odpravile dalje po svetu." in cell
|
||||
And I click "Add" button
|
||||
Then I should see "Živali pa so se odpravile dalje po svetu."
|
||||
|
||||
@javascript
|
||||
Scenario: Successful add Table result
|
||||
Given I am on Task results page
|
||||
And I click on "Table" button
|
||||
And I click "Table" button
|
||||
And I click on table cell one
|
||||
And I input "Vse to pa zaradi botra petelina, bog mu daj zdravje!" in cell
|
||||
And I click on "save-result" class button
|
||||
And I click "Add" button
|
||||
Then I should see "Vse to pa zaradi botra petelina, bog mu daj zdravje!"
|
||||
|
||||
@javascript
|
||||
@javascript
|
||||
Scenario: Successful edit Table task result
|
||||
Given I am on Task results page
|
||||
And I click on "Table" button
|
||||
And I click "Table" button
|
||||
And I fill in "ZOO" in "#result_name" field
|
||||
And I click on table cell one
|
||||
And I input "Živali pa so se odpravile dalje po svetu." in cell
|
||||
And I click on "save-result" class button
|
||||
And I input "Živali pa so se odpravile dalje po svetu." in cell
|
||||
And I click "Add" button
|
||||
And I click on ".fa-pencil-alt" sign
|
||||
And I fill in "LJ ZOO" in "#result_name" field
|
||||
And I click on table cell one
|
||||
And I input "Vse to pa zaradi botra petelina, bog mu daj zdravje!" in cell
|
||||
And I click on "save-result" class button
|
||||
And I input "Vse to pa zaradi botra petelina, bog mu daj zdravje!" in cell
|
||||
And I click "Save" button
|
||||
Then I should see "Vse to pa zaradi botra petelina, bog mu daj zdravje!"
|
||||
|
||||
@javascript
|
||||
Scenario: Successful add comment to a Table task result
|
||||
Given I am on Task results page
|
||||
And I click on "Table" button
|
||||
And I click on "save-result" class button
|
||||
And I click "Table" button
|
||||
And I click "Add" button
|
||||
And I click on ".result-panel-collapse-link" sign
|
||||
And I fill in "I was on Triglav one summer." in "message" textarea field
|
||||
And I click on "i.fas:nth-child(2)" sign
|
||||
|
@ -212,36 +212,37 @@ Scenario: Successful add comment to a Table task result
|
|||
@javascript
|
||||
Scenario: Successful edit comment to a Table task result
|
||||
Given I am on Task results page
|
||||
And I click on "Table" button
|
||||
And I click on "save-result" class button
|
||||
And I click "Table" button
|
||||
And I click "Add" button
|
||||
And I click on ".result-panel-collapse-link" sign
|
||||
And I fill in "I was on Triglav one summer." in "message" textarea field
|
||||
And I click on "i.fas:nth-child(2)" sign
|
||||
And WAIT
|
||||
And I click on ".comment-container" sign
|
||||
And I change comment "I was on Triglav one summer." with "I was on Triglav one summer and I do not have plans to go once more." of "#message"
|
||||
And I click on ".comment-container" sign
|
||||
And I change comment "I was on Triglav one summer." with "I was on Triglav one summer and I do not have plans to go once more." of "#message"
|
||||
And I click on ".save-button" sign
|
||||
Then I should see "I was on Triglav one summer and I do not have plans to go once more."
|
||||
|
||||
@javascript
|
||||
Scenario: Unsuccessful edit comment to a Table task result
|
||||
Given I am on Task results page
|
||||
And I click on "Table" button
|
||||
And I click on "save-result" class button
|
||||
And I click "Table" button
|
||||
And I click "Add" button
|
||||
And I click on ".result-panel-collapse-link" sign
|
||||
And I fill in "I was on Triglav one summer." in "message" textarea field
|
||||
And I click on "i.fas:nth-child(2)" sign
|
||||
And WAIT
|
||||
And I click on ".comment-container" sign
|
||||
And I change comment "I was on Triglav one summer." with "I was on Triglav one summer and I do not have plans to go once more." of "#message"
|
||||
And I change comment "I was on Triglav one summer." with "I was on Triglav one summer and I do not have plans to go once more." of "#message"
|
||||
And I click on ".cancel-button" sign
|
||||
Then I should see "I was on Triglav one summer."
|
||||
|
||||
@javascript
|
||||
Scenario: Unsuccessful delete comment to a Table task result
|
||||
Given I am on Task results page
|
||||
And I click on "Table" button
|
||||
And I click on "save-result" class button
|
||||
And I click "Table" button
|
||||
And I click "Add" button
|
||||
And I click on ".result-panel-collapse-link" sign
|
||||
And I fill in "I was on Triglav one summer." in "message" textarea field
|
||||
And I click on "i.fas:nth-child(2)" sign
|
||||
|
@ -254,8 +255,8 @@ Scenario: Unsuccessful delete comment to a Table task result
|
|||
@javascript
|
||||
Scenario: Successful delete comment to a Table task result
|
||||
Given I am on Task results page
|
||||
And I click on "Table" button
|
||||
And I click on "save-result" class button
|
||||
And I click "Table" button
|
||||
And I click "Add" button
|
||||
And I click on ".result-panel-collapse-link" sign
|
||||
And I fill in "I was on Triglav one summer." in "message" textarea field
|
||||
And I click on "i.fas:nth-child(2)" sign
|
||||
|
@ -268,59 +269,59 @@ Scenario: Successful delete comment to a Table task result
|
|||
@javascript
|
||||
Scenario: Successful archive Table result with Table name
|
||||
Given I am on Task results page
|
||||
And I click on "Table" button
|
||||
And I click on "save-result" class button
|
||||
And I click on "form-submit-link" class button
|
||||
And I click "Table" button
|
||||
And I click "Add" button
|
||||
And I click "fa-briefcase" SCIicon
|
||||
And I click to OK on confirm dialog
|
||||
Then I should see "Successfully archived table result in task Experiment design" flash message
|
||||
|
||||
@wip
|
||||
Scenario: Unsuccessful add File result #doesnt work
|
||||
Given I am on Task results page
|
||||
And I click on "File" button
|
||||
And I click on "save-result" button
|
||||
And I click "File" button
|
||||
And I click "Add" button
|
||||
Then I should see File "can't be blank"
|
||||
And I click to "Cancel" button
|
||||
And I click "Cancel" button
|
||||
|
||||
@javascript
|
||||
@javascript
|
||||
Scenario: Successful add File result with File name
|
||||
Given I am on Task results page
|
||||
And I click on "File" button
|
||||
And I click "File" button
|
||||
And I attach file "Moon.png" to the drag-n-drop field
|
||||
And I fill in "MED" in "div.form-group:nth-child(1) > input:nth-child(2)" field
|
||||
And I click on "save-result" class button
|
||||
And WAIT
|
||||
And I fill in "MED" in "div.form-group:nth-child(1) > input:nth-child(2)" field
|
||||
And I click "Add" button
|
||||
And WAIT
|
||||
Then I should see "MED"
|
||||
|
||||
@javascript
|
||||
Scenario: Successful add File result
|
||||
Given I am on Task results page
|
||||
And I click on "File" button
|
||||
And I click "File" button
|
||||
And I attach file "Moon.png" to the drag-n-drop field
|
||||
And I click on "save-result" class button
|
||||
And I click "Add" button
|
||||
And WAIT
|
||||
Then I should see "Moon"
|
||||
|
||||
@wip
|
||||
Scenario: Successful edit File result with File name (((#gets error - is a bug)))
|
||||
Given I am on Task results page
|
||||
And I click on "File" button
|
||||
And I click "File" button
|
||||
And I attach file "Moon.png" to the drag-n-drop field
|
||||
And I fill in "MED" in "div.form-group:nth-child(1) > input:nth-child(2)" field
|
||||
And I click on "save-result" class button
|
||||
And I fill in "MED" in "div.form-group:nth-child(1) > input:nth-child(2)" field
|
||||
And I click "Add" button
|
||||
And I click on ".fa-pencil-alt" sign
|
||||
And I fill in "STAR ZOO" in "#result_name" field
|
||||
And I click on "save-result" class button
|
||||
And I click "Add" button
|
||||
And WAIT
|
||||
Then I should see "STAR ZOO"
|
||||
|
||||
@javascript
|
||||
Scenario: Successful add comment to a File task result
|
||||
Given I am on Task results page
|
||||
And I click on "File" button
|
||||
And I click "File" button
|
||||
And I attach file "Moon.png" to the drag-n-drop field
|
||||
And I fill in "MED" in "div.form-group:nth-child(1) > input:nth-child(2)" field
|
||||
And I click on "save-result" class button
|
||||
And I fill in "MED" in "div.form-group:nth-child(1) > input:nth-child(2)" field
|
||||
And I click "Add" button
|
||||
And I click on ".result-panel-collapse-link" sign
|
||||
And I fill in "I was on Triglav one summer." in "message" textarea field
|
||||
And I click on "i.fas:nth-child(2)" sign
|
||||
|
@ -330,42 +331,42 @@ Scenario: Successful add comment to a File task result
|
|||
@javascript
|
||||
Scenario: Successful edit comment to a File task result
|
||||
Given I am on Task results page
|
||||
And I click on "File" button
|
||||
And I click "File" button
|
||||
And I attach file "Moon.png" to the drag-n-drop field
|
||||
And I fill in "MED" in "div.form-group:nth-child(1) > input:nth-child(2)" field
|
||||
And I click on "save-result" class button
|
||||
And I fill in "MED" in "div.form-group:nth-child(1) > input:nth-child(2)" field
|
||||
And I click "Add" button
|
||||
And I click on ".result-panel-collapse-link" sign
|
||||
And I fill in "I was on Triglav one summer." in "message" textarea field
|
||||
And I click on "i.fas:nth-child(2)" sign
|
||||
And WAIT
|
||||
And I click on ".comment-container" sign
|
||||
And I change comment "I was on Triglav one summer." with "I was on Triglav one summer and I do not have plans to go once more." of "#message"
|
||||
And I change comment "I was on Triglav one summer." with "I was on Triglav one summer and I do not have plans to go once more." of "#message"
|
||||
And I click on ".save-button" sign
|
||||
Then I should see "I was on Triglav one summer and I do not have plans to go once more."
|
||||
|
||||
@javascript
|
||||
Scenario: Unsuccessful edit comment to a File task result
|
||||
Given I am on Task results page
|
||||
And I click on "File" button
|
||||
And I click "File" button
|
||||
And I attach file "Moon.png" to the drag-n-drop field
|
||||
And I fill in "MED" in "div.form-group:nth-child(1) > input:nth-child(2)" field
|
||||
And I click on "save-result" class button
|
||||
And I fill in "MED" in "div.form-group:nth-child(1) > input:nth-child(2)" field
|
||||
And I click "Add" button
|
||||
And I click on ".result-panel-collapse-link" sign
|
||||
And I fill in "I was on Triglav one summer." in "message" textarea field
|
||||
And I click on "i.fas:nth-child(2)" sign
|
||||
And WAIT
|
||||
And I click on ".comment-container" sign
|
||||
And I change comment "I was on Triglav one summer." with "I was on Triglav one summer and I do not have plans to go once more." of "#message"
|
||||
And I change comment "I was on Triglav one summer." with "I was on Triglav one summer and I do not have plans to go once more." of "#message"
|
||||
And I click on ".cancel-button" sign
|
||||
Then I should see "I was on Triglav one summer."
|
||||
|
||||
@javascript
|
||||
Scenario: Unsuccessful delete comment to a File task result
|
||||
Given I am on Task results page
|
||||
And I click on "File" button
|
||||
And I click "File" button
|
||||
And I attach file "Moon.png" to the drag-n-drop field
|
||||
And I fill in "MED" in "div.form-group:nth-child(1) > input:nth-child(2)" field
|
||||
And I click on "save-result" class button
|
||||
And I fill in "MED" in "div.form-group:nth-child(1) > input:nth-child(2)" field
|
||||
And I click "Add" button
|
||||
And I click on ".result-panel-collapse-link" sign
|
||||
And I fill in "I was on Triglav one summer." in "message" textarea field
|
||||
And I click on "i.fas:nth-child(2)" sign
|
||||
|
@ -378,10 +379,10 @@ Scenario: Unsuccessful delete comment to a File task result
|
|||
@javascript
|
||||
Scenario: Successful delete comment to a File task result
|
||||
Given I am on Task results page
|
||||
And I click on "File" button
|
||||
And I click "File" button
|
||||
And I attach file "Moon.png" to the drag-n-drop field
|
||||
And I fill in "MED" in "div.form-group:nth-child(1) > input:nth-child(2)" field
|
||||
And I click on "save-result" class button
|
||||
And I fill in "MED" in "div.form-group:nth-child(1) > input:nth-child(2)" field
|
||||
And I click "Add" button
|
||||
And I click on ".result-panel-collapse-link" sign
|
||||
And I fill in "I was on Triglav one summer." in "message" textarea field
|
||||
And I click on "i.fas:nth-child(2)" sign
|
||||
|
@ -393,22 +394,22 @@ Scenario: Successful delete comment to a File task result
|
|||
@javascript
|
||||
Scenario: Successful archive File result with File name
|
||||
Given I am on Task results page
|
||||
And I click on "File" button
|
||||
And I click "File" button
|
||||
And I attach file "Moon.png" to the drag-n-drop field
|
||||
And I fill in "MED" in "div.form-group:nth-child(1) > input:nth-child(2)" field
|
||||
And I click on "save-result" class button
|
||||
And I click on "form-submit-link" class button
|
||||
And I fill in "MED" in "div.form-group:nth-child(1) > input:nth-child(2)" field
|
||||
And I click "Add" button
|
||||
And I click "fa-briefcase" SCIicon
|
||||
And I click to OK on confirm dialog
|
||||
Then I should see "Successfully archived file result in task Experiment design" flash message
|
||||
|
||||
@javascript
|
||||
Scenario: Download archived Text result
|
||||
Given I am on Task results page
|
||||
And I click on "Text" button
|
||||
And I click "Text" button
|
||||
And I fill in "LJ ZOO" in "#result_name" field
|
||||
And I fill in "Živali pa so se odpravile dalje po svetu." in "#result_text_attributes_textarea" rich text editor field
|
||||
And I click on "save-result" class button
|
||||
And I click on "form-submit-link" class button
|
||||
And I click "Add" button
|
||||
And I click "fa-briefcase" SCIicon
|
||||
And I click to OK on confirm dialog
|
||||
And I am on Task archive page
|
||||
And I click on "dropdownMenu1" id button
|
||||
|
@ -418,9 +419,9 @@ Scenario: Download archived Text result
|
|||
@javascript
|
||||
Scenario: Download archived Table result
|
||||
Given I am on Task results page
|
||||
And I click on "Table" button
|
||||
And I click on "save-result" class button
|
||||
And I click on "form-submit-link" class button
|
||||
And I click "Table" button
|
||||
And I click "Add" button
|
||||
And I click "fa-briefcase" SCIicon
|
||||
And I click to OK on confirm dialog
|
||||
And I am on Task archive page
|
||||
And I click on "dropdownMenu1" id button
|
||||
|
@ -430,11 +431,11 @@ Scenario: Download archived Table result
|
|||
@javascript
|
||||
Scenario: Download archived File result
|
||||
Given I am on Task results page
|
||||
And I click on "File" button
|
||||
And I click "File" button
|
||||
And I attach file "Moon.png" to the drag-n-drop field
|
||||
And I fill in "MED" in "div.form-group:nth-child(1) > input:nth-child(2)" field
|
||||
And I click on "save-result" class button
|
||||
And I click on "form-submit-link" class button
|
||||
And I fill in "MED" in "div.form-group:nth-child(1) > input:nth-child(2)" field
|
||||
And I click "Add" button
|
||||
And I click "fa-briefcase" SCIicon
|
||||
And I click to OK on confirm dialog
|
||||
And I am on Task archive page
|
||||
And I click on "dropdownMenu1" id button
|
||||
|
@ -445,11 +446,11 @@ Scenario: Download archived File result
|
|||
@javascript
|
||||
Scenario: Delete archived Text result
|
||||
Given I am on Task results page
|
||||
And I click on "Text" button
|
||||
And I click "Text" button
|
||||
And I fill in "LJ ZOO" in "#result_name" field
|
||||
And I fill in "Živali pa so se odpravile dalje po svetu." in "#result_text_attributes_textarea" rich text editor field
|
||||
And I click on "save-result" class button
|
||||
And I click on "form-submit-link" class button
|
||||
And I click "Add" button
|
||||
And I click "fa-briefcase" SCIicon
|
||||
And I click to OK on confirm dialog
|
||||
And I am on Task archive page
|
||||
And I click on "dropdownMenu1" id button
|
||||
|
@ -460,9 +461,9 @@ Scenario: Delete archived Text result
|
|||
@javascript
|
||||
Scenario: Delete archived Table result
|
||||
Given I am on Task results page
|
||||
And I click on "Table" button
|
||||
And I click on "save-result" class button
|
||||
And I click on "form-submit-link" class button
|
||||
And I click "Table" button
|
||||
And I click "Add" button
|
||||
And I click "fa-briefcase" SCIicon
|
||||
And I click to OK on confirm dialog
|
||||
And I am on Task archive page
|
||||
And I click on "dropdownMenu1" id button
|
||||
|
@ -473,14 +474,18 @@ Scenario: Delete archived Table result
|
|||
@javascript
|
||||
Scenario: Delete archived File result
|
||||
Given I am on Task results page
|
||||
And I click on "File" button
|
||||
And I click "File" button
|
||||
And I attach file "Moon.png" to the drag-n-drop field
|
||||
And I fill in "MED" in "div.form-group:nth-child(1) > input:nth-child(2)" field
|
||||
And I click on "save-result" class button
|
||||
And I click on "form-submit-link" class button
|
||||
And I fill in "MED" in "div.form-group:nth-child(1) > input:nth-child(2)" field
|
||||
And I click "Add" button
|
||||
And I click "fa-briefcase" SCIicon
|
||||
And I click to OK on confirm dialog
|
||||
And I am on Task archive page
|
||||
And I click on "dropdownMenu1" id button
|
||||
And I click "Delete" link within dropdown menu
|
||||
And I click to OK on confirm dialog
|
||||
Then I should see "Sucessfully removed result MED from task Experiment design." flash message
|
||||
|
||||
|
||||
# We need to optimize some tests... When you deleting archived result, we always adding result. This should be initial
|
||||
# state there, already
|
||||
|
|
|
@ -11,21 +11,30 @@ Given(/^the following users are registered:$/) do |table|
|
|||
end
|
||||
end
|
||||
|
||||
When(/^I click "(.+)" button$/) do |button|
|
||||
click_button(button)
|
||||
# When(/^I click "(.+)" button$/) do |button|
|
||||
# click_button(button)
|
||||
# end
|
||||
|
||||
Then('I click {string} button') do |button|
|
||||
# find('.btn', text: button).click
|
||||
sci_click_on_button(text: button)
|
||||
end
|
||||
|
||||
Then('I click {string} Scinote button') do |button|
|
||||
find('.btn', text: button).click
|
||||
Then('I click {string} SCIicon') do |icon_class|
|
||||
sci_click_on_icon(icon_class: icon_class)
|
||||
end
|
||||
#
|
||||
# Then('I click {string} SCIicon with delay') do |icon_class|
|
||||
# sci_click_on_icon(icon_class: icon_class, wait: 1)
|
||||
# end
|
||||
|
||||
Then('I click on {string} button') do |button|
|
||||
find('.btn', text: button).click
|
||||
end
|
||||
# Then('I click on {string} button') do |button|
|
||||
# find('.btn', text: button).click
|
||||
# end
|
||||
|
||||
Given('I click on {string} class button') do |button6|
|
||||
find('.btn', class: button6, match: :first).click
|
||||
end
|
||||
# Given('I click on {string} class button') do |button6|
|
||||
# find('.btn', class: button6, match: :first).click
|
||||
# end
|
||||
|
||||
Given('I click on {string} id button') do |button1|
|
||||
find('.btn', id: button1).click
|
||||
|
@ -166,9 +175,9 @@ Then(/^I should see "([^"]*)" in "([^"]*)" input field$/) do |text, container_id
|
|||
expect(container).to have_xpath("//input[@value='#{text}']")
|
||||
end
|
||||
|
||||
Given('I click {string} icon') do |id|
|
||||
find(:css, id).click
|
||||
end
|
||||
# Given('I click {string} icon') do |id|
|
||||
# find(:css, id).click
|
||||
# end
|
||||
|
||||
Then(/^(?:|I )click on "([^"]*)" element$/) do |selector|
|
||||
find(selector).click
|
||||
|
@ -180,18 +189,18 @@ end
|
|||
|
||||
Then(/^I change "([^"]*)" with "([^"]*)" in "([^"]*)" input field$/) do |old_text, new_text, container_id|
|
||||
wait_for_ajax
|
||||
container = page.find_by(id: container_id)
|
||||
container = page.find_by_id(container_id)
|
||||
expect(container).to have_xpath("//input[@value='#{old_text}']")
|
||||
container.find('input').set(new_text)
|
||||
end
|
||||
|
||||
Then(/^I fill in "([^"]*)" in "([^"]*)" textarea field$/) do |text, textarea_id|
|
||||
textarea = page.find_by(id: textarea_id)
|
||||
textarea = page.find_by_id(textarea_id)
|
||||
textarea.set(text)
|
||||
end
|
||||
|
||||
Then(/^I change "([^"]*)" with "([^"]*)" in "([^"]*)" textarea field$/) do |old_text, new_text, textarea_id|
|
||||
textarea = page.find_by(id: textarea_id)
|
||||
textarea = page.find_by_id(textarea_id)
|
||||
expect(textarea).to have_content(old_text)
|
||||
textarea.set(new_text)
|
||||
end
|
||||
|
@ -250,3 +259,5 @@ end
|
|||
Then('WAIT') do
|
||||
wait_for_ajax
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ include FirstTimeDataGenerator
|
|||
|
||||
Capybara.default_max_wait_time = 30
|
||||
#Capybara.asset_host = 'http://localhost:3001'
|
||||
Capybara.server_port = 3000
|
||||
Capybara.server_port = ENV['CAPYBARA_SERVER_PORT'] || 3000
|
||||
require 'selenium/webdriver'
|
||||
# enables email helper methods
|
||||
World(Capybara::Email::DSL)
|
||||
|
|
|
@ -1,5 +1,54 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
### Notes
|
||||
# Only CSS selector is working, Jquery is not working
|
||||
# e.g.: buttons = all("a.btn:contains(#{text}),input.btn[value=#{text}]")
|
||||
# Change wait time to 0, otherwise waiting default time (30s) to get empty array of elements
|
||||
|
||||
|
||||
### Improvments
|
||||
# Threads? When first is successful, kill others?
|
||||
|
||||
def check_active_team(team)
|
||||
expect(page).to have_selector '#team-switch button', text: team
|
||||
end
|
||||
|
||||
def sci_click_on_button(text:, position: 1, wait: 1)
|
||||
# default wait 1 second for now...
|
||||
raise 'Position cannot be lower than 1' if position < 1
|
||||
|
||||
# Find method is faster, so try with find, if nothing found, go with all
|
||||
# Use wait only for all, otherwise testsuit will wait on first Find if button is an form submit
|
||||
if position == 1
|
||||
begin
|
||||
btn = first('.btn', text: text, wait: wait)
|
||||
rescue Capybara::ElementNotFound # We assume and hope button is an input, so try to find input
|
||||
btn = first("input.btn[value=#{text}]", wait: wait)
|
||||
end
|
||||
else
|
||||
buttons = all('.btn', text: text, wait: wait)
|
||||
|
||||
unless buttons.any? # Maybe .btn is an input field, and does not have text, check for value
|
||||
buttons = all("input.btn[value=#{text}]", wait: wait)
|
||||
end
|
||||
|
||||
btn = buttons[position - 1]
|
||||
end
|
||||
|
||||
btn.click
|
||||
end
|
||||
|
||||
def sci_click_on_icon(icon_class:, position: 1, wait: 1)
|
||||
if position == 1
|
||||
icon = first("a>span.#{icon_class}", wait: wait)
|
||||
# Fallback here in icon is not in a and span... ?
|
||||
else
|
||||
icon = all("a>span.#{icon_class}:not(.hidden-lg)", wait: wait)[position-1]
|
||||
end
|
||||
|
||||
icon.click
|
||||
end
|
||||
|
||||
def sci_click_on_link(text, position: 1)
|
||||
|
||||
end
|
||||
|
|
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
Before Width: | Height: | Size: 99 KiB |
Loading…
Add table
Reference in a new issue