Skip to content

Commit

Permalink
fix: CI
Browse files Browse the repository at this point in the history
Signed-off-by: Khaled Emara <[email protected]>
  • Loading branch information
KhaledEmaraDev committed May 31, 2023
1 parent 26358f7 commit f48b84a
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.3
bundler-cache: true
bundler-cache: true
- name: Run tests
run: bundle exec rake
- run: gem uninstall -v '>= 2' -ax bundler || true
Expand Down Expand Up @@ -54,10 +54,10 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
bundler-cache: true
bundler-cache: true
- name: Run tests
run: bundle exec rake
- name: Run interaction tests
run: ./specs_e2e/rails_5_2/test.sh
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ test.describe("Rails using scenarios examples", () => {

test("setup basic scenario", async ({ page }) => {
await appScenario('basic');
await page.goto("/");
await expect(page).toHaveTitle("Rails Examples");
});
await page.goto("/"); });
});
9 changes: 5 additions & 4 deletions specs_e2e/rails_3_2/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bundle --version
bundle install --quiet --gemfile="$DIR/Gemfile" --retry 2 --path vendor/bundle

echo '-- cypress install'
bundle exec ./bin/rails g cypress_on_rails:install --install_folder=test/e2e --cypress_folder=test/cypress --playwright_folder=test/playwright --install_cypress --install_playwright --install_with=npm --skip
bundle exec ./bin/rails g cypress_on_rails:install --install_cypress --install_playwright --install_with=npm
rm -vf cypress/e2e/rails_examples/advance_factory_bot.cy.js
rm -vf cypress/e2e/rails_examples/using_vcr.cy.js

Expand All @@ -34,9 +34,10 @@ cp -fv ../cypress.config.js .
node_modules/.bin/cypress run --record
# fi

echo '-- cypress run'
cp -fv ../cypress.config.js .
npx playwright test
echo '-- playwright run'
cp -fv ../playwright.config.js .
npx playwright install-deps
npx playwright test playwright/e2e/

echo '-- stop rails server'
kill -9 `cat tmp/pids/server.pid`
9 changes: 5 additions & 4 deletions specs_e2e/rails_4_2/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ bundle --version
bundle install --quiet --gemfile="$DIR/Gemfile" --retry 2 --path vendor/bundle

echo '-- cypress and playwright install'
bundle exec ./bin/rails g cypress_on_rails:install --install_folder=spec/e2e --cypress_folder=spec/cypress --playwright_folder=spec/playwright --install_cypress --install_playwright --experimental --skip
bundle exec ./bin/rails g cypress_on_rails:install --install_folder=spec/e2e --cypress_folder=spec/cypress --playwright_folder=spec/playwright --install_cypress --install_playwright --experimental --install_with=npm --skip
rm -vf spec/cypress/e2e/rails_examples/advance_factory_bot.cy.js

echo '-- start rails server'
Expand All @@ -29,15 +29,16 @@ echo '-- cypress run'
cp -fv ../cypress.config.js spec/
# if [ -z $CYPRESS_RECORD_KEY ]
# then
# yarn run cypress run -P ./spec
# npx cypress run -P ./spec
# else
yarn run cypress run -P ./spec --record
npx cypress run -P ./spec --record
# fi

echo '-- playwright run'
cp -fv ../playwright.config.js spec/
cd spec
yarn run playwright test
npx playwright install-deps
npx playwright test spec/playwright/e2e/

echo '-- stop rails server'
kill -9 `cat tmp/pids/server.pid`
12 changes: 6 additions & 6 deletions specs_e2e/rails_5_2/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ bundle exec ./bin/rails db:drop || true
bundle exec ./bin/rails db:create db:migrate

echo '-- cypress and playwright install'
bundle exec ./bin/rails g cypress_on_rails:install --install_folder=test/e2e --cypress_folder=test/cypress --playwright_folder=test/playwright --install_cypress --install_playwright --skip
bundle exec ./bin/rails g cypress_on_rails:install --install_folder=test/e2e --cypress_folder=test/cypress --playwright_folder=test/playwright --install_cypress --install_playwright --install_with=npm --skip
rm -vf test/cypress/e2e/rails_examples/using_vcr.cy.js

echo '-- start rails server'
Expand All @@ -34,15 +34,15 @@ cp -fv ../cypress.config.js test/
cd test
# if [ -z $CYPRESS_RECORD_KEY ]
# then
# yarn run cypress run
# npx cypress run
# else
yarn run cypress run --record
npx cypress run --record
# fi

echo '-- playwright run'
cp -fv ../playwright.config.js test/
cd test
yarn run playwright test
cp -fv ../../playwright.config.js .
npx playwright install-deps
npx playwright test test/playwright/e2e/

echo '-- stop rails server'
kill -9 `cat ../tmp/pids/server.pid` || true
Empty file added tmp/pids/.gitkeep
Empty file.

0 comments on commit f48b84a

Please sign in to comment.