diff --git a/.github/workflows/cucumber-tests.yml b/.github/workflows/cucumber-tests.yml index 9dc3b693..9acd4e8b 100644 --- a/.github/workflows/cucumber-tests.yml +++ b/.github/workflows/cucumber-tests.yml @@ -1,19 +1,25 @@ -name: Cucumber Tests +name: Cucumber on: push - jobs: cucumber: - name: Run Cucmber Tests + name: Run Tests runs-on: ubuntu-latest - + concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true steps: - name: Checkout repository uses: actions/checkout@v2 + - name: Set up Docker + run: | + docker compose -f docker-compose.yml up --quiet-pull --detach + - name: Wait until the web server is ready + run: until curl -s -f -o /dev/null "http://localhost:8080"; do sleep 5; done - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: '3.2.0' - - name: Cache gems # You can cache your gems to make the workflow run faster + - name: Cache gems uses: actions/cache@v2 with: path: vendor/bundle @@ -23,6 +29,7 @@ jobs: - name: Install gems run: | bundle config path vendor/bundle - bundle install --jobs 4 --retry 3 + bundle install --quiet --jobs 4 --retry 3 - name: Run tests - run: bundle exec cucumber HEADLESS=true + run: | + bundle exec cucumber HEADLESS=true HOST=localhost staff-features/ diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..cfde4b9f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,48 @@ +version: "3" +services: + app: + image: archivesspace/archivesspace:latest + container_name: archivesspace + restart: on-failure + ports: + - "8080:8080" + - "8081:8081" + - "8082:8082" + - "8089:8089" + - "8090:8090" + depends_on: + - db + - solr + environment: + APPCONFIG_DB_URL: "jdbc:mysql://db:3306/archivesspace?useUnicode=true&characterEncoding=UTF-8&user=as&password=as123&useSSL=false&allowPublicKeyRetrieval=true" + APPCONFIG_FRONTEND_PROXY_URL: "http://localhost:8080" + APPCONFIG_PUBLIC_PROXY_URL: "http://localhost:8081" + APPCONFIG_SOLR_URL: "http://solr:8983/solr/archivesspace" + ASPACE_DB_MIGRATE: true + ASPACE_JAVA_XMX: "-Xmx2048m" + JAVA_OPTS: "-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xss1024k -Djavax.accessibility.assistive_technologies=''" + DB_ADDR: db + DB_NAME: archivesspace + DB_USER: as + DB_PASS: as123 + SOLR_URL: http://solr:8983/solr/archivesspace + db: + image: mysql:8 + cap_add: + - SYS_NICE + container_name: mysql + command: --character-set-server=utf8 --collation-server=utf8_unicode_ci --innodb_buffer_pool_size=1G --innodb_buffer_pool_instances=2 --log_bin_trust_function_creators=1 + ports: + - "3306:3306" + environment: + MYSQL_ROOT_PASSWORD: "123456" + MYSQL_DATABASE: archivesspace + MYSQL_USER: as + MYSQL_PASSWORD: as123 + solr: + image: archivesspace/solr:latest + command: solr-create -p 8983 -c archivesspace -d archivesspace + environment: + SOLR_JAVA_MEM: "-Xms2g -Xmx2g" + ports: + - "8983:8983" diff --git a/helpers/helpers.rb b/helpers/helpers.rb index 9fa6c3c6..27b1e2c1 100644 --- a/helpers/helpers.rb +++ b/helpers/helpers.rb @@ -19,6 +19,29 @@ def login_admin expect(page).to have_content 'Your friendly archives management tool.' element = find('.global-header .user-container') expect(element.text.strip).to eq 'admin' + + # Ensure the system has at least one repository + begin + element = find('.alert.alert-info.with-hide-alert') + + if element.text == 'To create your first Repository, click the System menu above and then Manage Repositories.' + click_on 'System' + click_on 'Manage Repositories' + click_on 'Create Repository' + + fill_in 'repository_repository__repo_code_', with: 'repository_test' + fill_in 'repository_repository__name_', with: 'Repository Test' + find('#repository_repository__publish_').check + click_on 'Save' + + expect(find('.alert.alert-success.with-hide-alert').text).to eq 'Repository Created' + expect(find('.alert.alert-info.with-hide-alert').text).to eq 'Repository is Currently Selected' + + visit STAFF_URL + end + rescue Capybara::ElementNotFound + # Continue + end end def create_resource(uuid)