Skip to content

Commit 02b634d

Browse files
committed
testing system tests & screenshots
1 parent f95e58b commit 02b634d

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

.github/workflows/test.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ env:
1313

1414
jobs:
1515
tests:
16-
name: General Ruby on Rails tests
16+
name: Ruby on Rails tests
1717
runs-on: ubuntu-latest
1818

1919
strategy:
2020
matrix:
2121
ruby_version: [3.1, 3.2]
22+
test_type: [test, test:system]
2223

2324
services:
2425
mysql:
@@ -40,7 +41,7 @@ jobs:
4041
- name: Setup dependencies
4142
run: |
4243
sudo apt-get -qq update
43-
sudo apt-get -yqq install libmariadb-dev libmagickwand-dev
44+
sudo apt-get -yqq install libmariadb-dev libmagickwand-dev firefox-esr
4445
- name: Setup Ruby
4546
uses: ruby/setup-ruby@v1
4647
with:
@@ -54,4 +55,11 @@ jobs:
5455
bundle exec rails db:schema:load
5556
bundle exec rails db:migrate
5657
bundle exec rails test:prepare
57-
- run: bundle exec rails test
58+
- run: bundle exec rails ${{ matrix.test_type }}
59+
- name: Upload screenshots
60+
if: ${{ matrix.test_type == 'test:system' }}
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: screenshots-${{ matrix.ruby_version }}
64+
path: ~/tmp/screenshots
65+
if-no-files-found: ignore

test/system/post_system_test.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ class PostSystemTest < ApplicationSystemTestCase
77
# Create
88
# -------------------------------------------------------
99

10+
test 'dummy test for screenshot uploading' do
11+
visit root_url
12+
take_screenshot
13+
end
14+
1015
test 'Not-signed in user cannot create a post' do
1116
visit root_url
1217
click_on 'Create Post'

0 commit comments

Comments
 (0)