-
Notifications
You must be signed in to change notification settings - Fork 63
Added Windows Tests #40
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
Merged
Naturalclar
merged 12 commits into
react-native-progress-view:master
from
TatianaKapos:TatianaKapos-Adding-WindowsTest
Aug 8, 2020
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ec5d87f
add windows support
TatianaKapos f26fb46
Merge https://github.com/react-native-community/progress-view
TatianaKapos 49d26f0
fixes merge conflict
TatianaKapos 6772bd8
added isInderterminate into example app
TatianaKapos fe0d3e5
ran 'yarn eslint . --fix'
TatianaKapos 0564b79
local images work, updated example app
TatianaKapos 7d700e4
fixed example app, updated Readme
TatianaKapos 268aff2
Copied and Pasted Windows Tests
TatianaKapos 20edf2d
pulling from master
TatianaKapos dfda4a6
Merge https://github.com/react-native-community/progress-view into Ta…
TatianaKapos 250e928
Added windows CI
TatianaKapos 29cd2b0
changed to on PR
TatianaKapos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| node_modules | ||
| node_modules | ||
| jest-setups/jest.setup.js | ||
| jest-setups/jest.setup.windows.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| name: Windows CI | ||
| on: [pull_request] | ||
|
|
||
| jobs: | ||
| run-windows-tests: | ||
| name: Build & run tests | ||
| runs-on: windows-2019 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| name: Checkout Code | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v1 | ||
| with: | ||
| node-version: '12.9.1' | ||
|
|
||
| - name: Setup MSBuild | ||
| uses: microsoft/setup-msbuild@v1.0.0 | ||
| with: | ||
| vs-version: 16.5 | ||
|
|
||
| - name: Setup NuGet | ||
| uses: NuGet/setup-nuget@v1.0.2 | ||
|
|
||
| - name: Check node modules cache | ||
| uses: actions/cache@v1 | ||
| id: yarn-cache | ||
| with: | ||
| path: ./node_modules | ||
| key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-yarn- | ||
| - name: Install node modules | ||
| if: steps.yarn-cache.outputs.cache-hit != 'true' | ||
| run: | ||
| yarn add react-native@0.62 --dev | ||
| yarn --pure-lockfile | ||
|
|
||
| - name: yarn build | ||
| if: steps.yarn-cache.outputs.cache-hit == 'true' | ||
| run: | | ||
| yarn build | ||
| yarn tsc | ||
|
|
||
| - name: NuGet restore | ||
| run: nuget restore example\windows\ProgressViewExample.sln | ||
|
|
||
| - name: Build x64 release | ||
| run: msbuild .\example\windows\ProgressViewExample.sln /p:Configuration=Release /p:Platform=x64 -m | ||
|
|
||
| - name: Deploy | ||
| shell: powershell | ||
| run: | | ||
| cd example | ||
| Copy-Item -Path windows\x64\Release -Recurse -Destination windows\ | ||
| npx react-native run-windows --arch x64 --release --no-build --no-packager | ||
|
|
||
|
|
||
| - name: Start Appium server | ||
| shell: powershell | ||
| run: Start-Process PowerShell -ArgumentList "yarn appium" | ||
|
|
||
| - name: Run tests | ||
| run: yarn test:windows | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| /** | ||
| * Copyright (c) Microsoft Corporation. All rights reserved. | ||
| * Licensed under the MIT License. | ||
| */ | ||
|
|
||
| import {driver, By2} from 'selenium-appium'; | ||
| import {until} from 'selenium-webdriver'; | ||
|
|
||
| const setup = require('../jest-setups/jest.setup'); | ||
| jest.setTimeout(50000); | ||
|
|
||
| beforeAll(() => { | ||
| return driver.startWithCapabilities(setup.capabilites); | ||
| }); | ||
|
|
||
| afterAll(() => { | ||
| return driver.quit(); | ||
| }); | ||
|
|
||
| describe('Windows Tests', () => { | ||
| test('Render every windows example app progress bars', async () => { | ||
| try { | ||
| await driver.wait( | ||
| until.elementLocated( | ||
| By2.nativeXpath('//ProgressBar[@AutomationId="p1"]'), | ||
| ), | ||
| ); | ||
| } catch (error) { | ||
| throw new Error('Progress Bar 1 failed to render'); | ||
| } | ||
| try { | ||
| await driver.wait( | ||
| until.elementLocated( | ||
| By2.nativeXpath('//ProgressBar[@AutomationId="p2"]'), | ||
| ), | ||
| ); | ||
| } catch (error) { | ||
| throw new Error('Progress Bar 2 failed to render'); | ||
| } | ||
| try { | ||
| await driver.wait( | ||
| until.elementLocated( | ||
| By2.nativeXpath('//ProgressBar[@AutomationId="p3"]'), | ||
| ), | ||
| ); | ||
| } catch (error) { | ||
| throw new Error('Progress Bar 3 failed to render'); | ||
| } | ||
| try { | ||
| await driver.wait( | ||
| until.elementLocated( | ||
| By2.nativeXpath('//ProgressBar[@AutomationId="p4"]'), | ||
| ), | ||
| ); | ||
| } catch (error) { | ||
| throw new Error('Progress Bar 4 failed to render'); | ||
| } | ||
| try { | ||
| await driver.wait( | ||
| until.elementLocated( | ||
| By2.nativeXpath('//ProgressBar[@AutomationId="Indeterminate"]'), | ||
| ), | ||
| ); | ||
| } catch (error) { | ||
| throw new Error('Indeterminate Progress Bar failed to render'); | ||
| } | ||
| try { | ||
| await driver.wait( | ||
| until.elementLocated( | ||
| By2.nativeXpath('//ProgressBar[@AutomationId="localimage"]'), | ||
| ), | ||
| ); | ||
| } catch (error) { | ||
| throw new Error('Local Image Progress Bar failed to render'); | ||
| } | ||
| try { | ||
| await driver.wait( | ||
| until.elementLocated( | ||
| By2.nativeXpath('//ProgressBar[@AutomationId="networkimage"]'), | ||
| ), | ||
| ); | ||
| } catch (error) { | ||
| throw new Error('Network Image Progress Bar failed to render'); | ||
| } | ||
| try { | ||
| await driver.wait( | ||
| until.elementLocated( | ||
| By2.nativeXpath('//ProgressBar[@AutomationId="trackcolor"]'), | ||
| ), | ||
| ); | ||
| } catch (error) { | ||
| throw new Error('Track Color Progress Bar failed to render'); | ||
| } | ||
| try { | ||
| await driver.wait( | ||
| until.elementLocated( | ||
| By2.nativeXpath('//ProgressBar[@AutomationId="bar"]'), | ||
| ), | ||
| ); | ||
| } catch (error) { | ||
| throw new Error('Bar Style Progress Bar failed to render'); | ||
| } | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,8 @@ | |
| # | ||
| .DS_Store | ||
|
|
||
| *.binlog | ||
|
|
||
| # Xcode | ||
| # | ||
| build/ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,78 @@ | ||
| /Bundle | ||
| *AppPackages* | ||
| *BundleArtifacts* | ||
| *Bundle | ||
|
|
||
| #OS junk files | ||
| [Tt]humbs.db | ||
| *.DS_Store | ||
| #Visual Studio files | ||
| *.[Oo]bj | ||
| *.user | ||
| *.aps | ||
| *.pch | ||
| *.vspscc | ||
| *.vssscc | ||
| *_i.c | ||
| *_p.c | ||
| *.ncb | ||
| *.suo | ||
| *.tlb | ||
| *.tlh | ||
| *.bak | ||
| *.[Cc]ache | ||
| *.ilk | ||
| *.log | ||
| *.lib | ||
| *.sbr | ||
| *.sdf | ||
| *.opensdf | ||
| *.opendb | ||
| *.unsuccessfulbuild | ||
| ipch/ | ||
| [Oo]bj/ | ||
| [Bb]in | ||
| [Dd]ebug*/ | ||
| [Rr]elease*/ | ||
| Ankh.NoLoad | ||
| # Visual C++ cache files | ||
| ipch/ | ||
| *.aps | ||
| *.ncb | ||
| *.opendb | ||
| *.opensdf | ||
| *.sdf | ||
| *.cachefile | ||
| *.VC.db | ||
| *.VC.VC.opendb | ||
| #MonoDevelop | ||
| *.pidb | ||
| *.userprefs | ||
| #Tooling | ||
| _ReSharper*/ | ||
| *.resharper | ||
| [Tt]est[Rr]esult* | ||
| *.sass-cache | ||
| #Project files | ||
| [Bb]uild/ | ||
| #Subversion files | ||
| .svn | ||
| # Office Temp Files | ||
| ~$* | ||
| # vim Temp Files | ||
| *~ | ||
| #NuGet | ||
| packages/ | ||
| *.nupkg | ||
| #ncrunch | ||
| *ncrunch* | ||
| *crunch*.local.xml | ||
| # visual studio database projects | ||
| *.dbmdl | ||
| #Test files | ||
| *.testsettings | ||
| #Other files | ||
| *.DotSettings | ||
| .vs/ | ||
| *project.lock.json | ||
| #Files generated by the VS build | ||
| **/Generated Files/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import {windowsAppDriverCapabilities} from 'selenium-appium'; | ||
|
|
||
| switch (platform) { | ||
| case 'windows': | ||
| const webViewWindowsAppId = 'ProgressViewExample_kvqejeg71e612!App'; | ||
| module.exports = { | ||
| capabilites: windowsAppDriverCapabilities(webViewWindowsAppId), | ||
| }; | ||
| break; | ||
| default: | ||
| throw 'Unknown platform: ' + platform; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| platform = 'windows'; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.