From 5d6814f3c316a584685c1fbe917adb1c21922330 Mon Sep 17 00:00:00 2001 From: Pavel Anihimovsky <47742067+pavelanihimovsky@users.noreply.github.com> Date: Mon, 11 May 2020 11:43:51 +0300 Subject: [PATCH] Update selenium core version and pipeline (#183) * Update seelenium core version and pipeline * Fix pipeline * Update GitHubRelease --- .../Aquality.Selenium.csproj | 2 +- .../Aquality.Selenium/Aquality.Selenium.xml | 65 +++++++++ azure-pipelines.yml | 135 +++++++++++------- 3 files changed, 146 insertions(+), 56 deletions(-) diff --git a/Aquality.Selenium/src/Aquality.Selenium/Aquality.Selenium.csproj b/Aquality.Selenium/src/Aquality.Selenium/Aquality.Selenium.csproj index 45a478d1..35e707b4 100644 --- a/Aquality.Selenium/src/Aquality.Selenium/Aquality.Selenium.csproj +++ b/Aquality.Selenium/src/Aquality.Selenium/Aquality.Selenium.csproj @@ -65,7 +65,7 @@ - + diff --git a/Aquality.Selenium/src/Aquality.Selenium/Aquality.Selenium.xml b/Aquality.Selenium/src/Aquality.Selenium/Aquality.Selenium.xml index b9146b1d..a02df0c0 100644 --- a/Aquality.Selenium/src/Aquality.Selenium/Aquality.Selenium.xml +++ b/Aquality.Selenium/src/Aquality.Selenium/Aquality.Selenium.xml @@ -154,6 +154,12 @@ Refreshes current page. + + + Provide interface to manage of browser tabs. + + instance of IBrowserTabNavigation. + Handles alert. @@ -323,6 +329,60 @@ Instance of desired Browser. + + + Provides functionality to work with browser tab navigation. + + + + + Gets current tab handle. + + Current tab handle. + + + + Gets opened tab handles. + + List of tab handles. + + + + Switches to tab. + + Tab handle. + Close current tab if true and leave it otherwise. + + + + Switches to tab. + + Tab index. + Close current tab if true and leave it otherwise. + + + + Switches to the last tab. + + Close current tab if true and leave it otherwise. + + + + Closes curent tab. + + + + + Opens new tab. + + Switches to new tab if true and stays at current otherwise. + + + + Navigates to desired url in new tab. + + String representation of URL. + Predefined JS scripts. @@ -482,6 +542,11 @@ Gets desired options for web driver. + + + WebDriver page load strategy. + + Gets download directory for web driver. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7b2c9dc7..96454761 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,61 +6,86 @@ pool: variables: buildConfiguration: 'Release' - profile: 'azure' - -steps: -- task: GitVersion@5 - displayName: 'Run GitVersion' - inputs: - runtime: 'core' - -- task: SonarCloudPrepare@1 - displayName: 'Prepare SonarCloud analysis' - inputs: - SonarCloud: 'SonarCloud' - organization: 'aqualityautomation' - projectKey: 'aquality-automation_aquality-selenium-dotnet' - projectName: 'aquality-selenium-dotnet' - projectVersion: '$(Build.BuildNumber)' - extraProperties: | - sonar.coverage.exclusions=**/** - -- script: dotnet build Aquality.Selenium/Aquality.Selenium.sln -c $(buildConfiguration) - displayName: 'Build solution - $(buildConfiguration)' - -- task: SonarCloudAnalyze@1 - displayName: 'Run SonarCloud code analysis' - continueOnError: true - -- task: SonarCloudPublish@1 - displayName: 'Publish SonarCloud quality gate results' - continueOnError: true - -- task: DotNetCoreCLI@2 - displayName: 'Run tests' - inputs: - command: 'test' - projects: '**/*Tests*/*.csproj' - arguments: -c $(buildConfiguration) --no-build - publishTestResults: true - -- script: dotnet pack Aquality.Selenium\src\Aquality.Selenium\Aquality.Selenium.csproj -c $(buildConfiguration) --no-build -p:Version=$(GitVersion.NuGetVersion) -o $(Build.ArtifactStagingDirectory) - displayName: 'Pack to NuGet package' - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) -- task: GitHubRelease@0 - displayName: 'Create tag on GitHub' - inputs: - gitHubConnection: 'GitHub' - repositoryName: 'aquality-automation/aquality-selenium-dotnet' - action: 'create' - tag: 'v$(GitVersion.NuGetVersion)' - tagSource: 'manual' - isPreRelease: contains(variables['GitVersion.NuGetVersion'], '-') +stages: +- stage: test + + jobs: + - job: sonar + displayName: Analyse code with SonarQube + + steps: + - task: SonarCloudPrepare@1 + displayName: 'Prepare SonarCloud analysis' + inputs: + SonarCloud: 'SonarCloud' + organization: 'aqualityautomation' + projectKey: 'aquality-automation_aquality-selenium-dotnet' + projectName: 'aquality-selenium-dotnet' + projectVersion: '$(Build.BuildNumber)' + extraProperties: | + sonar.coverage.exclusions=**/** + + - task: DotNetCoreCLI@2 + displayName: 'Build solution' + inputs: + command: 'build' + projects: Aquality.Selenium/Aquality.Selenium.sln + arguments: -c $(buildConfiguration) + + - task: SonarCloudAnalyze@1 + displayName: 'Run SonarCloud code analysis' + continueOnError: true + + - task: SonarCloudPublish@1 + displayName: 'Publish SonarCloud quality gate results' + + - job: tests + displayName: Run tests + + variables: + profile: 'azure' + + steps: + - task: DotNetCoreCLI@2 + displayName: 'Run tests' + inputs: + command: 'test' + projects: '**/*Tests*/*.csproj' + arguments: -c $(buildConfiguration) + publishTestResults: true + +- stage: deploy condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) -- task: PublishBuildArtifacts@1 - inputs: - targetPath: '$(Build.ArtifactStagingDirectory)' - artifactName: '_aquality-automation.aquality-selenium-dotnet' - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) \ No newline at end of file + jobs: + - job: release + displayName: 'Create tag on GitHub and publish NuGet package' + + steps: + - task: GitVersion@5 + displayName: 'Run GitVersion' + inputs: + runtime: 'core' + + - script: dotnet pack Aquality.Selenium\src\Aquality.Selenium\Aquality.Selenium.csproj -c $(buildConfiguration) -p:Version=$(GitVersion.NuGetVersion) -o $(Build.ArtifactStagingDirectory) + displayName: 'Pack to NuGet package' + + - task: GitHubRelease@0 + displayName: 'Create tag on GitHub' + inputs: + gitHubConnection: 'GitHub' + repositoryName: 'aquality-automation/aquality-selenium-dotnet' + action: 'create' + tag: 'v$(GitVersion.NuGetVersion)' + title: 'v$(GitVersion.NuGetVersion)' + tagSource: 'manual' + isPreRelease: contains(variables['GitVersion.NuGetVersion'], '-') + + - task: NuGetCommand@2 + displayName: 'Push NuGet package' + inputs: + command: 'push' + packagesToPush: '$(Build.ArtifactStagingDirectory)/**/Aquality.Selenium*.nupkg;!$(Build.ArtifactStagingDirectory)/**/Aquality.Selenium*.symbols.nupkg' + nuGetFeedType: 'external' + publishFeedCredentials: 'NuGet'