Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit e806576

Browse files
authored
Merge pull request #12 from react-native-windows/pipeline2
Pipeline2
2 parents 6ca1f40 + b3d8e1f commit e806576

File tree

9 files changed

+11330
-37
lines changed

9 files changed

+11330
-37
lines changed

.gitattributes

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

azure-pipelines.yml

Lines changed: 66 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,78 @@ steps:
2323
inputs:
2424
script: yarn run prepublishOnly
2525

26+
- task: PowerShell@2
27+
displayName: 'Replace the AppID'
28+
inputs:
29+
targetType: 'inline'
30+
script: '((Get-Content -path example/Setup.ts -Raw) -replace "Microsoft.WindowsCalculator_8wekyb3d8bbwe!App","Microsoft.WindowsCalculator.Dev_8wekyb3d8bbwe!App") | Set-Content -Path example/Setup.ts'
31+
- task: PowerShell@2
32+
displayName: 'Show the AppID'
33+
inputs:
34+
targetType: 'inline'
35+
script: 'Get-Content example/Setup.ts | foreach {Write-Output $_}'
36+
2637
- task: CmdLine@2
38+
displayName: yarn install
39+
inputs:
40+
script: yarn install
41+
workingDirectory: 'example'
42+
43+
- task: DeleteFiles@1
44+
displayName: Remove offical selenium-appium\dist
2745
inputs:
28-
script: |
29-
npm pack
46+
SourceFolder: 'example\node_modules\selenium-appium\dist'
47+
Contents: '*'
3048

3149
- task: CopyFiles@2
50+
displayName: copy built selenium-appium\dist
3251
inputs:
33-
sourceFolder: '$(Build.SourcesDirectory)'
34-
contents: '*.tgz'
35-
targetFolder: $(Build.ArtifactStagingDirectory)/npm
36-
displayName: 'Copy npm package'
52+
SourceFolder: 'dist'
53+
Contents: '**'
54+
TargetFolder: 'example\node_modules\selenium-appium\dist'
55+
OverWrite: true
3756

38-
- task: CopyFiles@2
57+
- task: DownloadGitHubRelease@0
58+
inputs:
59+
connection: 'react-native-windows'
60+
userRepository: 'react-native-windows/CalculatorPackage'
61+
defaultVersionType: 'latest'
62+
downloadPath: '$(System.ArtifactsDirectory)'
63+
64+
- task: ExtractFiles@1
65+
inputs:
66+
archiveFilePatterns: '$(System.ArtifactsDirectory)/*.zip'
67+
destinationFolder: 'TestApp'
68+
cleanDestinationFolder: true
69+
70+
- task: PowerShell@1
71+
displayName: 'Install Calculator Cert'
72+
inputs:
73+
scriptType: inlineScript
74+
arguments: '-NonInteractive -Verb RunAs'
75+
inlineScript: |
76+
$file = ( Get-ChildItem -Path TestApp\Calculator_$(PackageManifest)_Test\Calculator_$(PackageManifest)_x64.cer )
77+
$file | Import-Certificate -CertStoreLocation cert:\LocalMachine\Root
78+
79+
80+
- task: PowerShell@1
81+
displayName: 'Install Calculator Packages'
82+
inputs:
83+
scriptName: 'TestApp\Calculator_$(PackageManifest)_Test\Add-AppDevPackage.ps1'
84+
arguments: '-NonInteractive -Force:$true -Verb RunAs'
85+
86+
- task: Windows Application Driver@0
87+
inputs:
88+
OperationType: 'Start'
89+
WADArguments: 127.0.0.1 4723/wd/hub
90+
AgentResolution: 1080p
91+
92+
- task: CmdLine@2
3993
inputs:
40-
sourceFolder: '$(Build.SourcesDirectory)'
41-
contents: 'package.json'
42-
targetFolder: $(Build.ArtifactStagingDirectory)/npm
43-
displayName: 'Copy package.json'
94+
script: 'yarn run jest'
95+
workingDirectory: 'example'
4496

45-
- task: PublishBuildArtifacts@1
97+
- task: Windows Application Driver@0
4698
inputs:
47-
pathtoPublish: '$(Build.ArtifactStagingDirectory)/npm'
48-
artifactName: npm
49-
displayName: 'Publish npm artifact'
99+
OperationType: 'Stop'
100+
condition: succeededOrFailed()

example/Setup.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export const calculatorAppId = 'Microsoft.WindowsCalculator_8wekyb3d8bbwe!App'
2+
3+
export const capabilities = {
4+
browserName: '',
5+
platformName: 'windows',
6+
deviceName: 'WindowsPC',
7+
app: calculatorAppId
8+
}

example/__tests__/By2.test.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1+
/**
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License.
4+
*/
5+
16
import { By2, driver, WebDriver2 } from 'selenium-appium'
27
import { Builder, until } from 'selenium-webdriver';
8+
import { capabilities } from '../Setup'
39

410
jest.setTimeout(50000);
511

6-
const capabilities = {
7-
browserName: '',
8-
platformName: 'windows',
9-
deviceName: 'WindowsPC',
10-
app: 'Microsoft.WindowsCalculator_8wekyb3d8bbwe!App'
11-
}
12-
1312
const url = 'http://localhost:4723/wd/hub'
1413

1514
describe('By2', () => {

example/__tests__/Calculator.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
*/
55

66
import { driver, By2, windowsAppDriverCapabilities } from 'selenium-appium'
7+
import { calculatorAppId } from '../Setup'
78

89
jest.setTimeout(50000);
910

10-
const calculatorAppId = 'Microsoft.WindowsCalculator_8wekyb3d8bbwe!App'
1111
const capabilites = windowsAppDriverCapabilities(calculatorAppId)
1212

1313
beforeAll(() => {
14-
return driver.startWithCapabilities(capabilites);
14+
return driver.startWithCapabilities(capabilites);
1515
});
1616

1717
afterAll(() => {

example/__tests__/CalculatorWithPageObject.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
import { driver, By2, windowsAppDriverCapabilities } from 'selenium-appium'
77
import CalculatorPage from '../Pages/CalculatorPage'
8+
import { calculatorAppId } from '../Setup'
89

910
jest.setTimeout(50000);
1011

11-
const calculatorAppId = 'Microsoft.WindowsCalculator_8wekyb3d8bbwe!App'
1212
const capabilites = windowsAppDriverCapabilities(calculatorAppId)
1313

1414
beforeAll(() => {

example/__tests__/Driver2.test.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
import { By2, driver, WebDriver2 } from 'selenium-appium'
22
import { Builder, until } from 'selenium-webdriver';
3+
import { capabilities } from '../Setup';
34

45
jest.setTimeout(50000);
56

6-
const capabilities = {
7-
browserName: '',
8-
platformName: 'windows',
9-
deviceName: 'WindowsPC',
10-
app: 'Microsoft.WindowsCalculator_8wekyb3d8bbwe!App'
11-
}
12-
137
const url = 'http://localhost:4723/wd/hub'
148

159
describe('driver', () => {

0 commit comments

Comments
 (0)