Skip to content

Commit 5a3b204

Browse files
authored
Merge pull request #91 from spyoungtech/ci-fix
Ci fix
2 parents 29b1367 + 32aba6f commit 5a3b204

File tree

13 files changed

+164
-141
lines changed

13 files changed

+164
-141
lines changed

.github/workflows/publish.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
- name: setup python
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: 3.9
18+
19+
- name: build
20+
shell: bash
21+
run: |
22+
python -m pip install -r requirements.txt
23+
python -m pip install wheel
24+
python setup.py sdist bdist_wheel
25+
- name: Release PyPI
26+
shell: bash
27+
env:
28+
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
29+
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
30+
run: |
31+
pip install --upgrade twine
32+
twine upload dist/*
33+
- name: Release GitHub
34+
uses: softprops/action-gh-release@v1
35+
with:
36+
files: "dist/*"
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yaml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
on: [push, pull_request]
2+
3+
jobs:
4+
test:
5+
name: test
6+
runs-on: ${{ matrix.os }}
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
os: [ubuntu-latest, macos-latest, windows-latest]
11+
browser: [Chrome, Firefox, Safari, Edge]
12+
exclude:
13+
- os: macos-latest
14+
browser: Edge
15+
- os: windows-latest
16+
browser: Safari
17+
- os: ubuntu-latest
18+
browser: Safari
19+
- os: ubuntu-latest
20+
browser: Edge
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v2
25+
- uses: actions/setup-python@v2
26+
with:
27+
python-version: '3.9'
28+
29+
- name: enable-safaridriver
30+
if: ${{ matrix.os == 'macos-latest' }}
31+
run: sudo safaridriver --enable
32+
33+
- name: install-deps
34+
run: |
35+
python -m pip install -r ./requirements.txt
36+
python -m pip install coveralls pytest mock
37+
38+
- name: run unittests
39+
env:
40+
BEHAVE_WEBDRIVER: ${{ matrix.browser }}
41+
BEHAVE_WEBDRIVER_HEADLESS: "1"
42+
ENV_BASE_URL: "http://127.0.0.1:8000/"
43+
run: |
44+
coverage run -m pytest tests/unittests
45+
46+
- name: start-test-server
47+
shell: bash
48+
run: |
49+
cd tests/demo-app
50+
python ./runserver.py > /dev/null 2>&1 &
51+
cd ../..
52+
53+
- name: regedit
54+
if: ${{ matrix.os == 'windows-latest' }}
55+
shell: cmd
56+
run: |
57+
regedit /s .\ci\bfcache.reg
58+
59+
- name: run-behave-tests
60+
env:
61+
BEHAVE_WEBDRIVER: ${{ matrix.browser }}
62+
BEHAVE_WEBDRIVER_HEADLESS: "1"
63+
ENV_BASE_URL: "http://127.0.0.1:8000/"
64+
run: |
65+
coverage run -a -m behave tests/features
66+
67+
- name: coveralls
68+
if: ${{ success() }}
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
run: coveralls --service=github

.travis.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

behave_webdriver/driver.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,7 @@ class Edge(BehaveDriverMixin, webdriver.Edge):
692692
"""
693693
Edge driver class. Alternate constructors and browser-specific logic is implemented here.
694694
"""
695+
_driver_name = 'msedgedriver'
695696

696697

697698
class Opera(BehaveDriverMixin, webdriver.Opera):

ci/install.sh

Lines changed: 0 additions & 30 deletions
This file was deleted.

tests/features/click.feature

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Feature: Test how clicks are handled on a certain element
55
Background:
66
Given I open the site "/"
77

8+
@skip_safari
89
Scenario: Single click on a link should navigate to another page
910
When I click on the link "Navigate to example.com"
1011
Then I expect the url to contain "https://example.com"
@@ -14,12 +15,15 @@ Feature: Test how clicks are handled on a certain element
1415
When I click on the button "#toggleMessage"
1516
Then I expect that element "#message1" is visible
1617
And I expect that element "#message2" is not visible
18+
1719
@firefox_bug
20+
@skip_safari
1821
Scenario: Double click on the button #toggleMessage should display another message
1922
When I doubleclick on the element "#toggleMessage"
2023
Then I expect that element "#message1" is not visible
2124
And I expect that element "#message2" is visible
2225

26+
@skip_safari
2327
Scenario: Single click on the element #toggleBackground should make the elemnt red
2428
When I click on the element "#toggleBackground"
2529
@firefox_bug

tests/features/cookie.feature

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,11 @@ Feature: Test the existens and content of cookies
2020
Scenario: The cookie "test" should not contain the value "out of date"
2121
Then I expect that cookie "test" not contains "out of date"
2222

23-
#
24-
# Currently this test is failing in PhantomJS due to an Ghostdriver issue
25-
# https://github.com/detro/ghostdriver/issues/365
26-
#
27-
@Pending
2823
Scenario: The cookie "test3" should be created
2924
When I set a cookie "test3" with the content "more cookies"
3025
Then I expect that cookie "test3" exists
3126
And I expect that cookie "test3" contains "more cookies"
3227

33-
@Pending
3428
Scenario: The cookie "test3" should be deletable
3529
Then I expect that cookie "test3" exists
3630
When I delete the cookie "test3"

tests/features/elementSize.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ Feature: Test the width and height of a given element
44

55
Background:
66
Given I open the site "/"
7-
7+
@skip_safari
88
Scenario: The element #square100x100 whould have a width of 100px
99
Then I expect that element "#square100x100" is 100px broad
1010

1111
Scenario: The element #square100x100 whould have a height of 100px
1212
Then I expect that element "#square100x100" is 100px tall
13-
13+
@skip_safari
1414
Scenario: The element #square100x100 whould not have a width of 101px
1515
Then I expect that element "#square100x100" is not 101px broad
1616

tests/features/environment.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ def before_tag(context, tag):
4646

4747

4848
def before_feature(context, feature):
49+
if "skip_safari" in feature.tags and os.environ.get("BEHAVE_WEBDRIVER", '').lower() == 'safari':
50+
feature.skip()
51+
return
4952
if "fresh_driver" in feature.tags:
5053
context.behave_driver.quit()
5154
context.behave_driver = context.BehaveDriver()
@@ -56,3 +59,6 @@ def before_scenario(context, scenario):
5659
if "skip_firefox" in scenario.effective_tags and os.environ.get("BEHAVE_WEBDRIVER", '').lower() == 'firefox':
5760
scenario.skip("Skipping because @skip_firefox tag (usually this is because of a known-issue with firefox)")
5861
return
62+
if "skip_safari" in scenario.effective_tags and os.environ.get("BEHAVE_WEBDRIVER", '').lower() == 'safari':
63+
scenario.skip("Skipping because safari has issues we're not dealing with right now")
64+
return

tests/features/moveTo.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ Feature: Test moveTo elements
1919
Then I expect that element "#moveTo" has the class "moveToClass"
2020
@skip_firefox
2121
Scenario: Move to the element with a too large offset
22-
When I move to element "#moveTo" with an offset of 5000,5000
22+
When I move to element "#moveTo" with an offset of 941,21
2323
Then I expect that element "#moveTo" does not have the class "moveToClass"

0 commit comments

Comments
 (0)