Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup selenium testing #24

Open
wants to merge 6 commits into
base: DP-1025-upgrade-omniauth
Choose a base branch
from

Conversation

yzhoubk
Copy link
Contributor

@yzhoubk yzhoubk commented Apr 15, 2024

This branch is created based on omniauth upgrading branch, it only includes selenium setup codes

Capybara::Selenium::Driver.new(app,
browser: :remote,
capabilities:,
url: "http://#{ENV['SELENIUM_HOST'] || 'selenium'}:4444/",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try copying exactly what we got working in TIND-QA, which is a simplified version of what's configured for Framework. The option arguments and preferences differ a bit between the two and it's not immediately obvious what would cause a problem, so best to start with a known working config.

Copy link
Contributor

@danschmidt5189 danschmidt5189 Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ha! Per our discussion off-GitHub—a problem is that the Selenium container makes requests to localhost:3000, but the actual address (from its perspective) is app:3000. IIRC from having worked with Capybara like this in the past, something in the stack (Chrome?) will complain about hitting a hostname with an invalid TLD, so you may have to use app.test:3000 with a network alias added to your compose file:

services:
  app:
    networks:
      default:
        aliases:
          - app.test

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also had to reconfigure shm:

  1. Removed shm_size from the Compose file
  2. Added the Chrome argument --disable-dev-shm-usage

Having done both of those I'm now able to run the feature specs locally on an M-chip MacBook.

yzhoubk and others added 5 commits April 15, 2024 13:59
- Adds `--headless`
- Removes shared-memory related settings and disables shm

After doing this, I'm able to run the feature tests. Before adding the headless option I still had trouble with frequent Selenium Chrome crashes, but not since. In any case, those are "resolved" by running `docker compose restart selenium` and re-running the tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants