All Projects → Capgemini → powerapps-specflow-bindings

Capgemini / powerapps-specflow-bindings

Licence: MIT license
A SpecFlow bindings library for model-driven Power Apps.

Programming Languages

C#
18002 projects
typescript
32286 projects
Gherkin
971 projects
javascript
184084 projects - #8 most used programming language
powershell
5483 projects

Projects that are alternatives of or similar to powerapps-specflow-bindings

powerapps-packagedeployer-template
Enhanced deployment capabilities when deploying with the Power Apps Package Deployer.
Stars: ✭ 18 (-5.26%)
Mutual labels:  microsoft, dynamics, dynamics-crm, powerapps, power-platform, power-apps
development-hub
A continuous integration solution for Power Apps.
Stars: ✭ 21 (+10.53%)
Mutual labels:  dynamics, cds, dynamics-crm, dynamics-365, powerapps
DynamicsNode
Create simple scripts to interact with Dynamics CRM using Node.js
Stars: ✭ 27 (+42.11%)
Mutual labels:  dynamics, dynamics-crm, dynamics-365, xrm
generator-nullfactory-xrm
Yeoman generator for Dynamics 365 Solutions. It generates a project structure that facilitates the quick creation builds and automated release strategies with minimal effort.
Stars: ✭ 15 (-21.05%)
Mutual labels:  dynamics, dynamics-crm, dynamics-365, xrm
cds-for-code
VSCode extension for working with Microsoft Common Data Service (CDS)
Stars: ✭ 22 (+15.79%)
Mutual labels:  cds, dynamics-crm, dynamics-365
xrm-mock
📚 A fake implementation of the Xrm object model. Written in TypeScript against @types/xrm definitions.
Stars: ✭ 64 (+236.84%)
Mutual labels:  dynamics-crm, dynamics-365, xrm
PCF-Builder-VSCode
Build your Power Apps Component Framework custom controls faster. No need to remember the PCF CLI commands. All commands provided in one selection list for you to execute. https://marketplace.visualstudio.com/items?itemName=danish-naglekar.pcf-builder
Stars: ✭ 15 (-21.05%)
Mutual labels:  cds, dynamics-365, powerapps
Solopi
SoloPi 自动化测试工具
Stars: ✭ 4,461 (+23378.95%)
Mutual labels:  test-automation, ui-testing, automated-testing
Xrm-Quick-Edit
A Dynamics CRM Add-In for speeding up tasks such as translating or toggling field security on or off
Stars: ✭ 13 (-31.58%)
Mutual labels:  dynamics-crm, dynamics-365, xrm
xrm-mock-generator
📖  Generates a mock Xrm.Page object. Commonly used by xrm-mock to test Dynamics 365 client-side customisations.
Stars: ✭ 15 (-21.05%)
Mutual labels:  dynamics-crm, dynamics-365, xrm
Microsoft.Xrm.DevOps.Data
This library provides an easy way to generate filtered data compatible with the Configuration Data Migration Tool. These zip files can be used to push specific records between Dynamics 365 environments using the Dynamics 365 Package Deployer.
Stars: ✭ 20 (+5.26%)
Mutual labels:  dynamics, dynamics-crm, dynamics-365
Dynamics365BulkSolutionExporter
[Work In Progress] Take backup of whole D365 organization or export multiple solutions.
Stars: ✭ 30 (+57.89%)
Mutual labels:  dynamics-crm, dynamics-365
jdi-dark
Powerful Framework for Backend Automation Testing on Java (Rest, Soap, WebSocket)
Stars: ✭ 36 (+89.47%)
Mutual labels:  test-automation, automated-testing
Federal-Business-Applications
US Government Business Applications Demo Repository
Stars: ✭ 103 (+442.11%)
Mutual labels:  microsoft, powerapps
scenarioo
Scenarioo Docu Viewer for Automated Documentation using UI/E2E-Tests
Stars: ✭ 62 (+226.32%)
Mutual labels:  test-automation, ui-testing
Alertjs
Dialog Builder allows you to create fully customisable dialogs and popups in Dynamics 365.
Stars: ✭ 80 (+321.05%)
Mutual labels:  microsoft, dynamics
Daxif
A framework for automating a lot of xRM development processses. By using simple F# script commands/files one can save a lot of time and effort during this process by using Delegates DAXIF# library.
Stars: ✭ 37 (+94.74%)
Mutual labels:  dynamics-crm, dynamics-365
integration-dynamics
The easiest way to connect Dynamics 365 with WordPress.
Stars: ✭ 17 (-10.53%)
Mutual labels:  dynamics-crm, dynamics-365
SpecFlow.DependencyInjection
SpecFlow plugin that enables to use Microsoft.Extensions.DependencyInjection for resolving test dependencies.
Stars: ✭ 21 (+10.53%)
Mutual labels:  microsoft, specflow
Advanced-MultiSelect-for-Dynamics
Advanced MultiSelect for Dynamics 365 / Dynamics CRM is a multi-select / multi-checkbox control on a form. It represents a set of related data items (based on N:N relations + FetchXml) and gives a user an ability to associate/disassociate records of related entities in a quick and convenient way.
Stars: ✭ 14 (-26.32%)
Mutual labels:  dynamics-crm, dynamics-365

Power Apps SpecFlow Bindings

Build Status Quality Gate Status Coverage

A SpecFlow bindings library for Power Apps.

The aim of this project is to make Power Apps test automation easier, faster and more accessible. It does this by providing a library of generic SpecFlow step bindings that adhere to test automation best practices. This allows effective automated tests to be written without the dependency on developers who are both proficient with Power Apps and test automation.

Table of Contents

Installation

Follow the guidance in the Installation and Setup section in SpecFlow's docs. After installing the IDE integration and setting up your project, install the NuGet package.

PM> Install-Package Capgemini.PowerApps.SpecFlowBindings

Once the NuGet package is installed, follow the SpecFlow documentation on referencing an external binding library. At the time of writing - for SpecFlow 3.x - you should update a specflow.json file in your project root as follows -

{
    "stepAssemblies": [
        { "assembly": "Capgemini.PowerApps.SpecFlowBindings" }
    ]
}

WebDrivers

We do not have a dependency on any specific WebDrivers. You will need to ensure that the correct WebDrivers are available in your project based on the browser that you are targetting. For example - if your configuration file is targetting Chrome - you can install the Chrome WebDriver via NuGet -

PM> Install-Package Selenium.Chrome.WebDriver

Usage

Configuration

Installing the NuGet package creates a power-apps-bindings.yml file in your project's root. This is used to configure the URL, browser, and users that will be used for your tests.

url: SPECFLOW_POWERAPPS_URL # mandatory
useProfiles: false # optional - defaults to false if not set
browserOptions: # optional - will use default EasyRepro options if not set
  browserType: Chrome
  headless: true
  width: 1920
  height: 1080
  startMaximized: false
  driversPath: ChromeWebDriver # optional - [Recommended when running tests from Azure DevOps Microsoft-hosted agent](https://docs.microsoft.com/en-us/azure/devops/pipelines/test/continuous-test-selenium?view=azure-devops#decide-how-you-will-deploy-and-test-your-app)
applicationUser: # optional - populate if creating test data for users other than the current user
  tenantId: SPECFLOW_POWERAPPS_TENANTID optional # mandatory
  clientId: SPECFLOW_POWERAPPS_CLIENTID # mandatory
  clientSecret: SPECFLOW_POWERAPPS_CLIENTSECRET # mandatory
users: # mandatory
  - username: SPECFLOW_POWERAPPS_USERNAME_SALESPERSON # mandatory
    password: SPECFLOW_POWERAPPS_PASSWORD_SALESPERSON # optional - populate if this user will be logging in for tests
    alias: a salesperson # mandatory

The URL, driversPath, usernames, passwords, and application user details will be set from environment variable (if found). Otherwise, the value from the config file will be used. The browserOptions node supports anything in the EasyRepro BrowserOptions class.

Tests will be distributed evenly between the users if multiple users are configured with the same alias. This can be helpful when you run a large number of tests in parallel and are encountering errors due to user-level platform API limits.

User profiles

Setting the useProfiles property to true causes the solution to create and use a unique profile for each user listed in the config file. This currently only works in Chrome & Firefox and attempting to use it with Edge or IE will cause an exception to be thrown. By using profiles test runs for the same user will not be required to re-authenticate, this saves time during test runs. To take full advantage of this you will need to have the "Stay Signed In" prompt enabled.

Writing feature files

You can use the predefined step bindings to write your tests.

Scenario: User can create a new account
 Given I am logged in to the 'Sales Team Member' app as 'an admin'
 When I open the 'Accounts' sub area of the 'Customers' group
 Then I can see the 'New' command

Alternatively, write your own step bindings (see below).

Writing step bindings

You can write your own step bindings that have thread-safe access to EasyRepro and the Selenium WebDriver. This ensures that your tests can be ran safely in parallel. You can do this by creating a class decorated with the SpecFlow BindingAttribute and inheriting from the PowerAppsStepDefiner base class. You can then create your SpecFlow step bindings by interacting with the XrmApp and Driver properties.

[Binding]
public class MyCustomSteps : PowerAppsStepDefiner
{
    [Given(@"I have a custom step")]
    public void GivenIHaveACustomStep()
    {
      // Interact with the inherited EasyRepro 'Browser' object.
      // Interact with the inherited Selenium 'Driver' object.
    }
}

Test setup

Bindings

We avoid performing test setup via the UI. This speeds up test execution and makes the tests more robust (as UI automation is more fragile than using supported APIs). Given steps should therefore be carried out using the Client API, WebAPI or Organization Service.

You can create test data by using the following Given steps -

Given I have created 'a record'

or

Given 'someone' has created 'a record with a difference'

These bindings look for a corresponding JSON file in a data folder in the root of your project. The file is resolved using a combination of the directory structure and the file name. For example, the bindings above could resolve the following files:

└───data
    │   a record.json
    │
    └───a record
            with a difference.json

If you are using the binding which creates data as someone other than the current user, you will need the following configuration to be present:

  • a user with a matching alias in the users array that has the username set
  • an application user with sufficient privileges to impersonate the above user configured in the applicationUser property.

Refer to the Microsoft documentation on creating an application user here.

Data file syntax

The JSON is similar to that expected by Web API when creating records via a deep insert.

{
  "@logicalName": "account",
  "@alias": "sample account",
  "name": "Sample Account",
  "primarycontactid": {
    "firstname": "John",
    "lastname": "Smith"
  },
  "opportunity_customer_accounts": [
    {
      "name": "Opportunity associated to Sample Account",
      "Opportunity_Tasks": [{ "subject": "Task associated to opportunity" }]
    }
  ]
}

The example above will create the following:

  • An account
  • An primary contact related to the account
  • An opportunity related to the account
  • A task related to the opportunity

In addition to the standard Web API syntax, we also have the following:

Property Description Requirement
@logicalName the entity logical name of the root record Mandatory (unless included using @extends - see below)
@alias a friendly alias that can be used to reference the created record in certain bindings. Can be set on nested records Optional
@extends a relative path to a data file to extend. Records in arrays are merged by index (you may need to include blank objects to insert new records into the array) Optional

Dynamic data

We support faker.js moustache template syntax for generating dynamic test data at run-time. Please refer to the faker documentation for all of the functionality that is available. The below JSON will generate a contact with a random name, credit limit, email address, and date of birth in the past 90 years:

{
  "@logicalName": "contact",
  "@alias": "a dynamically generated contact",
  "lastname": "{{name.firstName}}",
  "firstname": "{{name.lastName}}",
  "[email protected]": "{{finance.amount}}",
  "emailaddress1": "{{internet.email}}",
  "[email protected]": "{{date.past(90)}}",
  "[email protected]": "sample account"
}

When using faker syntax, you must also annotate number or date fields using @faker.number, @faker.date or @faker.dateonly to ensure that the JSON is formatted correctly.

You can also dynamically set lookups by alias using <lookup>@alias.bind (this is limited to aliased records in other files - not the current file).

Contributing

Please refer to the Contributing guide.

Licence

Power Apps SpecFlow Bindings is released under the MIT licence.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].