Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.
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
63 changes: 63 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
81 changes: 66 additions & 15 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,78 @@ steps:
inputs:
script: yarn run prepublishOnly

- task: PowerShell@2
displayName: 'Replace the AppID'
inputs:
targetType: 'inline'
script: '((Get-Content -path example/Setup.ts -Raw) -replace "Microsoft.WindowsCalculator_8wekyb3d8bbwe!App","Microsoft.WindowsCalculator.Dev_8wekyb3d8bbwe!App") | Set-Content -Path example/Setup.ts'
- task: PowerShell@2
displayName: 'Show the AppID'
inputs:
targetType: 'inline'
script: 'Get-Content example/Setup.ts | foreach {Write-Output $_}'

- task: CmdLine@2
displayName: yarn install
inputs:
script: yarn install
workingDirectory: 'example'

- task: DeleteFiles@1
displayName: Remove offical selenium-appium\dist
inputs:
script: |
npm pack
SourceFolder: 'example\node_modules\selenium-appium\dist'
Contents: '*'

- task: CopyFiles@2
displayName: copy built selenium-appium\dist
inputs:
sourceFolder: '$(Build.SourcesDirectory)'
contents: '*.tgz'
targetFolder: $(Build.ArtifactStagingDirectory)/npm
displayName: 'Copy npm package'
SourceFolder: 'dist'
Contents: '**'
TargetFolder: 'example\node_modules\selenium-appium\dist'
OverWrite: true

- task: CopyFiles@2
- task: DownloadGitHubRelease@0
inputs:
connection: 'react-native-windows'
userRepository: 'react-native-windows/CalculatorPackage'
defaultVersionType: 'latest'
downloadPath: '$(System.ArtifactsDirectory)'

- task: ExtractFiles@1
inputs:
archiveFilePatterns: '$(System.ArtifactsDirectory)/*.zip'
destinationFolder: 'TestApp'
cleanDestinationFolder: true

- task: PowerShell@1
displayName: 'Install Calculator Cert'
inputs:
scriptType: inlineScript
arguments: '-NonInteractive -Verb RunAs'
inlineScript: |
$file = ( Get-ChildItem -Path TestApp\Calculator_$(PackageManifest)_Test\Calculator_$(PackageManifest)_x64.cer )
$file | Import-Certificate -CertStoreLocation cert:\LocalMachine\Root


- task: PowerShell@1
displayName: 'Install Calculator Packages'
inputs:
scriptName: 'TestApp\Calculator_$(PackageManifest)_Test\Add-AppDevPackage.ps1'
arguments: '-NonInteractive -Force:$true -Verb RunAs'

- task: Windows Application Driver@0
inputs:
OperationType: 'Start'
WADArguments: 127.0.0.1 4723/wd/hub
AgentResolution: 1080p

- task: CmdLine@2
inputs:
sourceFolder: '$(Build.SourcesDirectory)'
contents: 'package.json'
targetFolder: $(Build.ArtifactStagingDirectory)/npm
displayName: 'Copy package.json'
script: 'yarn run jest'
workingDirectory: 'example'

- task: PublishBuildArtifacts@1
- task: Windows Application Driver@0
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/npm'
artifactName: npm
displayName: 'Publish npm artifact'
OperationType: 'Stop'
condition: succeededOrFailed()
8 changes: 8 additions & 0 deletions example/Setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const calculatorAppId = 'Microsoft.WindowsCalculator_8wekyb3d8bbwe!App'

export const capabilities = {
browserName: '',
platformName: 'windows',
deviceName: 'WindowsPC',
app: calculatorAppId
}
13 changes: 6 additions & 7 deletions example/__tests__/By2.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/

import { By2, driver, WebDriver2 } from 'selenium-appium'
import { Builder, until } from 'selenium-webdriver';
import { capabilities } from '../Setup'

jest.setTimeout(50000);

const capabilities = {
browserName: '',
platformName: 'windows',
deviceName: 'WindowsPC',
app: 'Microsoft.WindowsCalculator_8wekyb3d8bbwe!App'
}

const url = 'http://localhost:4723/wd/hub'

describe('By2', () => {
Expand Down
4 changes: 2 additions & 2 deletions example/__tests__/Calculator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
*/

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

jest.setTimeout(50000);

const calculatorAppId = 'Microsoft.WindowsCalculator_8wekyb3d8bbwe!App'
const capabilites = windowsAppDriverCapabilities(calculatorAppId)

beforeAll(() => {
return driver.startWithCapabilities(capabilites);
return driver.startWithCapabilities(capabilites);
});

afterAll(() => {
Expand Down
2 changes: 1 addition & 1 deletion example/__tests__/CalculatorWithPageObject.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

import { driver, By2, windowsAppDriverCapabilities } from 'selenium-appium'
import CalculatorPage from '../Pages/CalculatorPage'
import { calculatorAppId } from '../Setup'

jest.setTimeout(50000);

const calculatorAppId = 'Microsoft.WindowsCalculator_8wekyb3d8bbwe!App'
const capabilites = windowsAppDriverCapabilities(calculatorAppId)

beforeAll(() => {
Expand Down
8 changes: 1 addition & 7 deletions example/__tests__/Driver2.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import { By2, driver, WebDriver2 } from 'selenium-appium'
import { Builder, until } from 'selenium-webdriver';
import { capabilities } from '../Setup';

jest.setTimeout(50000);

const capabilities = {
browserName: '',
platformName: 'windows',
deviceName: 'WindowsPC',
app: 'Microsoft.WindowsCalculator_8wekyb3d8bbwe!App'
}

const url = 'http://localhost:4723/wd/hub'

describe('driver', () => {
Expand Down
Loading