diff --git a/.github/workflows/android_e2e_tests.yml b/.github/workflows/android_e2e_tests.yml index 979f7d9b9..6b37ca648 100644 --- a/.github/workflows/android_e2e_tests.yml +++ b/.github/workflows/android_e2e_tests.yml @@ -166,5 +166,12 @@ jobs: if: failure() # Runs only if a previous step fails uses: actions/upload-artifact@v4 with: - name: android-test-logs - path: /home/txnproc/trace/ \ No newline at end of file + name: android-e2e_tests + path: /home/txnproc/trace/ + + - name: Upload Appium Logs on Failure + if: failure() + uses: actions/upload-artifact@v4 + with: + name: android-e2e_tests_appium + path: appium.log \ No newline at end of file diff --git a/.github/workflows/android_navigation_tests.yml b/.github/workflows/android_navigation_tests.yml index 345bcae4e..15879cd05 100644 --- a/.github/workflows/android_navigation_tests.yml +++ b/.github/workflows/android_navigation_tests.yml @@ -149,6 +149,13 @@ jobs: - name: Run Android Navigation Tests run: dotnet test TransactionMobile.Maui.UiTests/TransactionMobile.Maui.UiTests.csproj --filter "(Category=PRNavTest)&(Category=Android)" --no-restore + - name: Upload Appium Logs on Failure + if: failure() + uses: actions/upload-artifact@v4 + with: + name: android-software_navigation_tests_appium + path: appium.log + hardware_navigation_tests: runs-on: ubuntu-latest steps: @@ -291,3 +298,10 @@ jobs: - name: Run Android Navigation Tests run: dotnet test TransactionMobile.Maui.UiTests/TransactionMobile.Maui.UiTests.csproj --filter "(Category=PRHWNavTest)&(Category=Android)" --no-restore + + - name: Upload Appium Logs on Failure + if: failure() + uses: actions/upload-artifact@v4 + with: + name: android-hardware_navigation_tests_appium + path: appium.log \ No newline at end of file diff --git a/.github/workflows/windows_e2e_tests.yml b/.github/workflows/windows_e2e_tests.yml new file mode 100644 index 000000000..d4c192b8c --- /dev/null +++ b/.github/workflows/windows_e2e_tests.yml @@ -0,0 +1,84 @@ +name: Build and Run Windows End to End Tests + +on: + pull_request: + branches: + - main + +jobs: + end_to_end_tests: + runs-on: windows-2022 + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Build Windows SQL Server + run: | + cd SQLDocker + docker build -t mssqlserver:2022-ltsc2022 --build-arg SQL_VERSION=2022 --build-arg WIN_VERSION=ltsc2022 . + + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v1.1 + with: + vs-prerelease: true + + - name: Set up .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '8.0.x' + + - name: Install MAUI workloads + run: | + dotnet workload install maui + + - name: Install Appium and Drivers + run: | + npm install -g appium --unsafe-perm=true --allow-root + appium driver install --source=npm appium-windows-driver + + - name: Start Appium Server + run: | + nohup appium --log appium.log & + + - name: Restore MAUI App for Android + run: dotnet restore TransactionMobile.Maui.sln --source ${{ secrets.PUBLICFEEDURL }} --source ${{ secrets.PRIVATEFEED_URL }} --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json + + - name: Build Code + run: dotnet build TransactionMobile.Maui/TransactionMobile.Maui.csproj -f net8.0-android -c Release --no-restore + + - name: Decrypt PFX File + run: | + echo "${{ secrets.WINDOWSSIGNINGCERT }}" > cert.pfx.asc + certutil -decode cert.pfx.asc cert.pfx + + - name: Add Cert to Store + run: certutil -user -q -p ${{ secrets.WINDOWSSIGNINGCERTPWD }} -importpfx cert.pfx NoRoot + + - name: Publish App + run: | + dotnet publish TransactionMobile.Maui/TransactionMobile.Maui.csproj -c Release -f net8.0-windows10.0.19041.0 /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="${{ secrets.WINDOWSSIGNINGCERTTHUMBPRINT }}" + + - name: Install App + shell: powershell + run: | + Import-Module Appx + .\TransactionMobile.Maui/bin/Release/net8.0-windows10.0.19041.0/win10-x64/AppPackages/TransactionMobile.Maui_1.0.0.0_Test/Install.ps1 -Force + + - name: Run Windows End To End Tests + env: + IsCI: true + run: dotnet test TransactionMobile.Maui.UiTests/TransactionMobile.Maui.UiTests.csproj --filter "(Category=PRTest)&(Category=Windows)" --no-restore + + - name: Upload Logs on Failure + if: failure() # Runs only if a previous step fails + uses: actions/upload-artifact@v4 + with: + name: windows-e2e_tests + path: C:\\Users\\runneradmin\\txnproc + + - name: Upload Appium Logs on Failure + if: failure() + uses: actions/upload-artifact@v4 + with: + name: windows-e2e_tests_appium + path: appium.log diff --git a/.github/workflows/windows_navigation_tests.yml b/.github/workflows/windows_navigation_tests.yml index de3da7f07..90f804306 100644 --- a/.github/workflows/windows_navigation_tests.yml +++ b/.github/workflows/windows_navigation_tests.yml @@ -62,4 +62,11 @@ jobs: - name: Run Windows Navigation Tests run: dotnet test TransactionMobile.Maui.UiTests/TransactionMobile.Maui.UiTests.csproj --filter "(Category=PRNavTest)&(Category=Windows)" --no-restore + - name: Upload Appium Logs on Failure + if: failure() + uses: actions/upload-artifact@v4 + with: + name: windows-software_navigation_tests_appium + path: appium.log + \ No newline at end of file