diff --git a/.github/actions/setup-firefox/action.yml b/.github/actions/setup-firefox/action.yml index fe0bda3e5bc91..15e4828c9aa16 100644 --- a/.github/actions/setup-firefox/action.yml +++ b/.github/actions/setup-firefox/action.yml @@ -9,8 +9,15 @@ runs: using: "composite" steps: - name: Setup Firefox - uses: browser-actions/setup-firefox@latest - with: - firefox-version: ${{ inputs.version }} - - name: Setup geckodriver - uses: browser-actions/setup-geckodriver@latest + # uses: browser-actions/setup-firefox@latest + # with: + # firefox-version: ${{ inputs.version }} + # with window changes + run: wget https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/GxXrnY5kSaqpP83rXCLBrA/runs/0/artifacts/public/build/target.tar.bz2 -O firefox.tar.gz && mkdir -p /opt/hostedtoolcache/firefox/latest/x64 && tar xvf firefox.tar.gz --strip-components=1 -C /opt/hostedtoolcache/firefox/latest/x64/ + shell: bash + - name: Check Firefox + run: /opt/hostedtoolcache/firefox/latest/x64/firefox --full-version + shell: bash + - name: Check GeckoDriver + run: geckodriver --version + shell: bash diff --git a/.github/workflows/ci-python.yml b/.github/workflows/ci-python.yml index a7f504b1b5941..27d4ca455596a 100644 --- a/.github/workflows/ci-python.yml +++ b/.github/workflows/ci-python.yml @@ -20,179 +20,9 @@ jobs: with: bazel-target-prefix: '//py' - tox_flake8: - if: ${{ needs.check_workflow.outputs.result == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || contains(toJson(github.event.commits), '[run python]') == true }} - needs: check_workflow - runs-on: ubuntu-latest - steps: - - name: Checkout source tree - uses: actions/checkout@v2 - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7.10 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox==2.4.1 - - name: Test with tox - run: tox -c py/tox.ini - env: - TOXENV: flake8 - - tox_docs: - if: ${{ needs.check_workflow.outputs.result == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || contains(toJson(github.event.commits), '[run python]') == true }} - needs: check_workflow - runs-on: ubuntu-latest - steps: - - name: Checkout source tree - uses: actions/checkout@v2 - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7.10 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox==2.4.1 - - name: Test with tox - run: tox -c py/tox.ini - env: - TOXENV: docs - - tox_mypy: - if: ${{ needs.check_workflow.outputs.result == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || contains(toJson(github.event.commits), '[run python]') == true }} - needs: check_workflow - runs-on: ubuntu-latest - steps: - - name: Checkout source tree - uses: actions/checkout@v2 - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7.9 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox==2.4.1 - - name: Test with tox - run: | - tox -c py/tox.ini -- --cobertura-xml-report ci || true - bash <(curl -s https://codecov.io/bash) -f py/ci/cobertura.xml - env: - TOXENV: mypy - - unit_tests: - if: ${{ needs.check_workflow.outputs.result == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || contains(toJson(github.event.commits), '[run python]') == true }} - needs: check_workflow - runs-on: ubuntu-latest - steps: - - name: Checkout source tree - uses: actions/checkout@v2 - - name: Cache Bazel artifacts - uses: actions/cache@v2 - with: - path: | - ~/.cache/bazel-disk - ~/.cache/bazel-repo - key: ${{ runner.os }}-bazel-python-unit-tests-${{ hashFiles('**/BUILD.bazel') }} - restore-keys: | - ${{ runner.os }}-bazel-python-unit-tests- - - name: Setup bazelisk - uses: ./.github/actions/setup-bazelisk - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7.10 - - name: Setup Java - uses: actions/setup-java@v1 - with: - java-version: '11' - - name: Run unit tests - uses: ./.github/actions/bazel - with: - command: test //py:unit - - chrome_tests: - if: ${{ needs.check_workflow.outputs.result == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || contains(toJson(github.event.commits), '[run python]') == true }} - needs: [ check_workflow, unit_tests ] - runs-on: ubuntu-latest - steps: - - name: Checkout source tree - uses: actions/checkout@v2 - - name: Cache Bazel artifacts - uses: actions/cache@v2 - with: - path: | - ~/.cache/bazel-disk - ~/.cache/bazel-repo - key: ${{ runner.os }}-bazel-chrome-tests-${{ hashFiles('**/BUILD.bazel') }} - restore-keys: | - ${{ runner.os }}-bazel-chrome-tests- - ${{ runner.os }}-bazel-python-unit-tests- - - name: Setup bazelisk - uses: ./.github/actions/setup-bazelisk - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7.10 - - name: Setup Java - uses: actions/setup-java@v1 - with: - java-version: '11' - - name: Setup Chrome and ChromeDriver - uses: ./.github/actions/setup-chrome - - name: Start XVFB - run: Xvfb :99 & - - name: Run browser tests in Chrome - uses: ./.github/actions/bazel-test - with: - query: //py:test-chrome - attempts: 3 - env: - DISPLAY: :99 - - firefox_tests_remote: - if: ${{ needs.check_workflow.outputs.result == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || contains(toJson(github.event.commits), '[run python]') == true }} - needs: [ check_workflow, unit_tests ] - runs-on: ubuntu-latest - steps: - - name: Checkout source tree - uses: actions/checkout@v2 - - name: Cache Bazel artifacts - uses: actions/cache@v2 - with: - path: | - ~/.cache/bazel-disk - ~/.cache/bazel-repo - key: ${{ runner.os }}-bazel-firefox-tests-${{ hashFiles('**/BUILD.bazel') }} - restore-keys: | - ${{ runner.os }}-bazel-firefox-tests- - ${{ runner.os }}-bazel-python-unit-tests- - - name: Setup bazelisk - uses: ./.github/actions/setup-bazelisk - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7.10 - - name: Setup Java - uses: actions/setup-java@v1 - with: - java-version: '11' - - name: Setup Firefox and GeckoDriver - uses: ./.github/actions/setup-firefox - - name: Start XVFB - run: Xvfb :99 & - - name: Run browser tests in Firefox (Remote) - uses: ./.github/actions/bazel - with: - command: test --jobs 1 //py:test-remote - env: - DISPLAY: :99 - firefox_tests: if: ${{ needs.check_workflow.outputs.result == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || contains(toJson(github.event.commits), '[run python]') == true }} - needs: [ check_workflow, unit_tests ] + needs: [ check_workflow ] runs-on: ubuntu-latest steps: - name: Checkout source tree diff --git a/py/selenium/webdriver/firefox/service.py b/py/selenium/webdriver/firefox/service.py index 3ce21f88a7f74..ee53a095dfbb9 100644 --- a/py/selenium/webdriver/firefox/service.py +++ b/py/selenium/webdriver/firefox/service.py @@ -56,6 +56,8 @@ def __init__(self, executable_path: str = DEFAULT_EXECUTABLE_PATH, self.service_args.append("--websocket-port") self.service_args.append("%d" % utils.free_port()) + self.service_args.append("-vv") + # Set the webdriver port self.service_args.append("--port") self.service_args.append("%d" % self.port) diff --git a/py/selenium/webdriver/firefox/webdriver.py b/py/selenium/webdriver/firefox/webdriver.py index b8c70e27ff8aa..3178f1487698f 100644 --- a/py/selenium/webdriver/firefox/webdriver.py +++ b/py/selenium/webdriver/firefox/webdriver.py @@ -171,6 +171,8 @@ def __init__(self, firefox_profile=None, firefox_binary=None, log_path=service_log_path) self.service.start() + os.environ["MOZ_LOG"] = "Widget:5" + executor = FirefoxRemoteConnection( remote_server_addr=self.service.service_url, ignore_proxy=options._ignore_local_proxy)