From b3eebc8a21babb2c7f40c8471a21d5ca6204b42b Mon Sep 17 00:00:00 2001 From: Kieran Date: Tue, 26 Mar 2024 19:43:37 +1100 Subject: [PATCH] try more random stuff --- .github/workflows/ui_tests.yml | 6 +++++- UITests/FindInPageTests.swift | 12 ++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ui_tests.yml b/.github/workflows/ui_tests.yml index 47eb383d2c..340dc69cea 100644 --- a/.github/workflows/ui_tests.yml +++ b/.github/workflows/ui_tests.yml @@ -85,7 +85,11 @@ jobs: # --header "Content-Type: application/json" \ # --data ' { "data": { "name": "GH Workflow Failure - UI Tests", "projects": [ "${{ vars.MACOS_APP_DEVELOPMENT_ASANA_PROJECT_ID }}" ], "notes" : "The end to end workflow has failed. See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" } }' - + - name: Show me html file content + run: | + ls -latr /Users/runner/Documents + cat /Users/runner/Documents/lorem_ipsum.html + - name: Publish tests report uses: mikepenz/action-junit-report@v4 if: always() diff --git a/UITests/FindInPageTests.swift b/UITests/FindInPageTests.swift index d15abad731..84c713d91a 100644 --- a/UITests/FindInPageTests.swift +++ b/UITests/FindInPageTests.swift @@ -31,7 +31,7 @@ class FindInPageTests: XCTestCase { } override class func tearDown() { - removeLocalHTML() + //removeLocalHTML() } override func setUpWithError() throws { @@ -432,8 +432,12 @@ private extension FindInPageTests { /// A shared URL to reference the local HTML file class var loremIpsumFileURL: URL { let loremIpsumFileName = "lorem_ipsum.html" - let tempDirectory = FileManager.default.temporaryDirectory - let loremIpsumHTMLFileURL = tempDirectory.appendingPathComponent(loremIpsumFileName) + XCTAssertNotNil( + FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first, + "It wasn't possible to obtain a local file URL for the sandbox Documents directory." + ) + let documentsDirectory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first! + let loremIpsumHTMLFileURL = documentsDirectory.appendingPathComponent(loremIpsumFileName) return loremIpsumHTMLFileURL } @@ -450,7 +454,7 @@ private extension FindInPageTests { let loremIpsumData = Data(loremIpsumHTML.utf8) do { - try loremIpsumData.write(to: loremIpsumFileURL, options: [.atomic, .noFileProtection ]) + try loremIpsumData.write(to: loremIpsumFileURL, options: []) } catch { XCTFail("It wasn't possible to write out the required local HTML file for the tests: \(error.localizedDescription)") }