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

Fix to support screenshots / images below sub directories #28

Merged
merged 3 commits into from
Sep 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 5 additions & 32 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: [python27, python36, python37, python38, python39]
robotframework: [2.8.2, 2.8.7, 2.9.2, 3.0.4, 3.1.2, 3.2.2, 4.0.3, 4.1.3, 5.0.0]
exclude:
- python: python27
robotframework: 5.0.0
- python: python36
robotframework: 2.8.2
- python: python36
robotframework: 2.8.7
- python: python36
robotframework: 2.9.2
- python: python37
robotframework: 2.8.2
- python: python37
robotframework: 2.8.7
- python: python37
robotframework: 2.9.2
- python: python38
robotframework: 2.8.2
- python: python38
robotframework: 2.8.7
- python: python38
robotframework: 2.9.2
- python: python39
robotframework: 2.8.2
- python: python39
robotframework: 2.8.7
- python: python39
robotframework: 2.9.2
python: [python38, python39]
robotframework: [3.2.2, 4.0.3, 4.1.3, 5.0.0]
steps:
- uses: actions/checkout@v3.0.2
- uses: cachix/install-nix-action@v17
- uses: actions/checkout@v4.0.0
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v10
- uses: cachix/cachix-action@v12
with:
name: datakurre
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
Expand Down
9 changes: 6 additions & 3 deletions src/robotsuite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,12 +451,15 @@ def runTest(self):
path = os.path.join(dirname, filename)
if os.path.isfile(path):
copy_filename = filename\
.replace(os.path.sep, '')\
.replace(os.path.sep, '_')\
.replace(os.pardir, '')
shutil.copyfile(path, "%s%s" % (prefix, copy_filename))
# Fix 'a' and 'img' tags to target the copied versions
data = re.sub(r'(href|src)="([^"]+\.png)"',
'\\1="%s\\2"' % prefix, data)
for attr, value in re.findall(r'(href|src)="([^"]+\.png)"', data):
data = data.replace(
attr + '="' + value + '"',
attr + '="' + prefix + value.replace(os.path.sep, '_') + '"',
)

# Try to merge the second 'output.xml' into the first one or into the
# final one from the previous test run when requested by setting
Expand Down