Skip to content

Commit

Permalink
fixes test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzschepp committed May 4, 2018
1 parent 81d288f commit 6251f93
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 55 deletions.
28 changes: 7 additions & 21 deletions .travis.yml
Expand Up @@ -5,11 +5,6 @@ env:
- MOZ_HEADLESS=1

install:
- wget -N https://github.com/mozilla/geckodriver/releases/download/v0.20.1/geckodriver-v0.20.1-linux64.tar.gz -O geckodriver.tar.gz
- tar xzf geckodriver.tar.gz
- rm geckodriver.tar.gz
- chmod +x geckodriver
- sudo mv geckodriver /usr/local/bin/geckodriver
- npm install
- bundle install --jobs=3 --retry=3 --deployment
- npm run build
Expand All @@ -29,24 +24,15 @@ before_install:
- sudo apt-get -qq update
- sudo apt-get install libav-tools imagemagick
- curl -O https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.4.6/elasticsearch-2.4.6.deb && sudo dpkg -i --force-confnew elasticsearch-2.4.6.deb && sudo service elasticsearch restart
- mysql -e 'CREATE DATABASE kor_test;'
- cp deploy/database.travis.yml config/database.yml
# - npm install
# - npm run build
# - bundle install

# - deploy/dockerize.sh $TRAVIS_COMMIT test
# - docker pull mysql
# - docker pull elasticsearch:2.4.4
# - docker run -d -e MYSQL_ROOT_PASSWORD=root --name mysql mysql
# - docker run -d --name elastic elasticsearch:2.4.4

# install: true
- wget -N https://github.com/mozilla/geckodriver/releases/download/v0.20.1/geckodriver-v0.20.1-linux64.tar.gz -O geckodriver.tar.gz
- tar xzf geckodriver.tar.gz
- rm geckodriver.tar.gz
- chmod +x geckodriver
- sudo mv geckodriver /usr/local/bin/geckodriver

script:
- mysql -e 'CREATE DATABASE kor_test;'
- cp deploy/database.travis.yml config/database.yml
- bundle exec rake db:test:load
- bundle exec cucumber features/
- bundle exec rspec spec/
# - docker run --rm --link mysql:mysql --link elastic:elastic docker.coneda.net:443/kor:$TRAVIS_COMMIT bundle exec rake db:drop db:setup db:test:load
# - docker run --rm --link mysql:mysql --link elastic:elastic docker.coneda.net:443/kor:$TRAVIS_COMMIT bundle exec rspec spec --format=progress
# - docker run --rm --link mysql:mysql --link elastic:elastic -e HEADLESS=true docker.coneda.net:443/kor:$TRAVIS_COMMIT bundle exec cucumber features --format=progress
44 changes: 21 additions & 23 deletions Gemfile.lock
Expand Up @@ -43,8 +43,8 @@ GEM
tzinfo (~> 1.1)
acts-as-taggable-on (3.5.0)
activerecord (>= 3.2, < 5)
addressable (2.5.1)
public_suffix (~> 2.0, >= 2.0.2)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
angularjs-rails (1.5.6)
arel (6.0.4)
ast (2.2.0)
Expand All @@ -64,20 +64,20 @@ GEM
slim (>= 1.3.6, < 4.0)
terminal-table (~> 1.4)
builder (3.2.3)
capybara (2.15.1)
capybara (2.18.0)
addressable
mini_mime (>= 0.1.3)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
childprocess (0.8.0)
xpath (>= 2.0, < 4.0)
childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11)
climate_control (0.0.3)
activesupport (>= 3.0)
cocaine (0.5.8)
climate_control (>= 0.0.3, < 1.0)
coderay (1.1.0)
coderay (1.1.2)
coffee-rails (4.2.2)
coffee-script (>= 2.2.0)
railties (>= 4.0.0)
Expand Down Expand Up @@ -128,7 +128,7 @@ GEM
factory_girl (~> 4.7.0)
railties (>= 3.0.0)
fastercsv (1.5.5)
ffi (1.9.18)
ffi (1.9.23)
gherkin (4.1.3)
globalid (0.4.0)
activesupport (>= 4.2.0)
Expand Down Expand Up @@ -156,19 +156,19 @@ GEM
mime-types (>= 1.16, < 4)
method_profiler (2.0.1)
hirb (>= 0.6.0)
method_source (0.8.2)
method_source (0.9.0)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mimemagic (0.3.0)
mini_mime (0.1.4)
mini_portile2 (2.2.0)
mini_mime (1.0.0)
mini_portile2 (2.3.0)
minitest (5.10.2)
multi_json (1.12.1)
multi_test (0.1.2)
mysql2 (0.4.2)
nokogiri (1.8.0)
mini_portile2 (~> 2.2.0)
nokogiri (1.8.2)
mini_portile2 (~> 2.3.0)
paperclip (4.3.6)
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
Expand All @@ -185,15 +185,14 @@ GEM
rails (>= 3.1)
power_assert (0.2.7)
powerpack (0.1.1)
pry (0.10.3)
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
public_suffix (2.0.5)
method_source (~> 0.9.0)
public_suffix (3.0.2)
puma (3.9.1)
quiet_assets (1.1.0)
railties (>= 3.1, < 5.0)
rack (1.6.8)
rack (1.6.10)
rack-cors (0.4.0)
rack-test (0.6.3)
rack (>= 1.0)
Expand Down Expand Up @@ -265,9 +264,9 @@ GEM
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
selenium-webdriver (3.5.2)
selenium-webdriver (3.11.0)
childprocess (~> 0.5)
rubyzip (~> 1.0)
rubyzip (~> 1.2)
sexp_processor (4.7.0)
simplecov (0.11.2)
docile (~> 1.1.0)
Expand All @@ -277,7 +276,6 @@ GEM
slim (3.0.6)
temple (~> 0.7.3)
tilt (>= 1.3.3, < 2.1)
slop (3.6.0)
spreadsheet (1.1.4)
ruby-ole (>= 1.0)
sprockets (3.7.1)
Expand Down Expand Up @@ -315,8 +313,8 @@ GEM
crack (>= 0.3.2)
hashdiff
will_paginate (3.0.7)
xpath (2.1.0)
nokogiri (~> 1.3)
xpath (3.0.0)
nokogiri (~> 1.8)

PLATFORMS
ruby
Expand Down Expand Up @@ -377,4 +375,4 @@ DEPENDENCIES
will_paginate (~> 3.0.3)

BUNDLED WITH
1.16.0
1.16.1
3 changes: 3 additions & 0 deletions app/assets/stylesheets/modules/widgets.css.sass
Expand Up @@ -90,6 +90,9 @@ $black_default: #1E1E1E

cursor: pointer

[kor-entity-widget]
display: inline-block

img
width: 100%

Expand Down
12 changes: 6 additions & 6 deletions features/easyrel.feature
Expand Up @@ -21,9 +21,9 @@ Feature: Inplace relationship editor
Given I am logged in as "admin"
And I am on the entity page for "Mona Lisa"
Then I should see "Mona Lisa"
And I should not see "Create link"
And I should not see "Create relationship"
When I click element "[data-name=plus]" within ".relationships"
Then I should see "Create link"
Then I should see "Create relationship"

@javascript
Scenario: Click the 'Create' button without having the form completed
Expand All @@ -45,7 +45,7 @@ Feature: Inplace relationship editor
And I fill in "terms" with "schrei"
And I click element "[kor-id='2']"
And I press "Save"
And I should not see "Create link"
And I should not see "Create relationship"
Then I should see "Der Schrei" within ".relationship"

@javascript
Expand All @@ -58,7 +58,7 @@ Feature: Inplace relationship editor
And I click button "Add" within ".relationship .properties"
And I fill in ".property input" with "this is almost certain"
And I press "Save"
And I should not see "Edit link"
And I should not see "Edit relationship"
And I should see "Relationship has been changed"
And I should see "this is almost certain" within ".relationship"

Expand All @@ -82,7 +82,7 @@ Feature: Inplace relationship editor
When I click element "[data-name=pen]" within ".relationships"
And I select "is equivalent to" from "relation_name"
And I press "Save"
And I should not see "Edit link"
And I should not see "Edit relationship"
And I should see "Relationship has been changed"
And I should see "is equivalent to" within ".relationships"
And I should not see "is similar to" within ".relationships"
Expand All @@ -98,7 +98,7 @@ Feature: Inplace relationship editor
And I follow "recently created"
And I click on entity "The Last Supper"
And I press "Save"
And I should not see "Edit link"
And I should not see "Edit relationship"
And I should see "Relationship has been changed"
And I should see "is similar to" within ".relationships"
And I should see "The Last Supper" within ".relationships"
Expand Down
2 changes: 1 addition & 1 deletion features/entities.feature
Expand Up @@ -175,7 +175,7 @@ Feature: Entities
Then I should not see "Mona Lisa"

Given user "admin" is allowed to "view" collection "side" through credential "side_admins"
When I go to the entity page for "Leonardo da Vinci"
When I reload the page
Then I should see "Mona Lisa"


Expand Down
9 changes: 6 additions & 3 deletions features/media.feature
Expand Up @@ -4,28 +4,31 @@ Feature: Media
I want to be able to upload, transform and link media


@javascript @nodelay
@javascript
Scenario: Rotate an uploaded image
Given I am logged in as "admin"
And the medium "spec/fixtures/image_a.jpg"
And everything is processed
When I go to the entity page for the last medium
And I follow "Rotate_cw"
Then I should be on the entity page for the last medium


@javascript @nodelay
@javascript
Scenario: Previews for uploaded images
Given I am logged in as "admin"
And the medium "spec/fixtures/image_a.jpg"
And everything is processed
And I go to the root page
And I go to the entity page for the last medium
Then I should see element "img[src*='/media/images/preview/000/000/001/image.jpg']" within ".viewer"


@javascript @nodelay
@javascript
Scenario: Upload a video and watch it
Given I am logged in as "admin"
And the medium "spec/fixtures/video_a.m4v"
And everything is processed
When I go to the entity page for the last medium
And I click on the player link
Then I should see the video player
Expand Down
4 changes: 4 additions & 0 deletions features/step_definitions/processing_steps.rb
@@ -1,3 +1,7 @@
Given /^everything is indexed$/ do
Kor::Elastic.index_all
end

Given /^everything is processed$/ do
Delayed::Worker.new.work_off
end
2 changes: 1 addition & 1 deletion features/step_definitions/web_steps.rb
Expand Up @@ -331,7 +331,7 @@
page.evaluate_script('window.history.back()')
end

When(/^I refresh the page$/) do
When(/^I (?:refresh|reload) the page$/) do
page.evaluate_script("window.location.reload()")
end

Expand Down

0 comments on commit 6251f93

Please sign in to comment.