Giter Club home page Giter Club logo

angular-testcafe's Introduction

angular-testcafe Tests - E2E

A custom Angular builder for TestCafe. Serves the Angular application, and then runs the TestCafe tests.

⚠️angular-testcafe supersedes @politie/angular-testcafe-builder⚠️

@politie/angular-testcafe-builder authors (Dutch National Police and Tim Nederhoff in person) have transferred the repository, related code, assets, and rights to DevExpress. The TestCafe team maintains and supports the package under the new name angular-testcafe.

If your projects are still using @politie/angular-testcafe-builder, we recommend that you switch to angular-testcafe. The development of @politie/angular-testcafe-builder is discontinued: it won't receive any updates, even for critical bugs and security vulnerabilities.

Install

$ npm install --save-dev angular-testcafe

Use in angular.json

{
  "projects": {
    "my-project-e2e": {
      "architect": {
        "e2e": {
          "builder": "angular-testcafe:testcafe",
          "options": {
            "browsers": [
              "chrome --no-sandbox",
              "firefox"
            ],
            "src": ["e2e/*.e2e-spec.ts"],
            "reporters": [
              {
                "name": "html",
                "output": "path/to/my/report.html"
              },
              {
                "name": "spec"
              }
            ]
          }
        }
      }
    }
  }
}

NOTE: check schema.json for a list of all options

A tutorial how to use Angular and Testcafe combined with this builder can be found here

build

$ npm run build

pack

$ npm pack

NOT Implemented (TODO):

  • remote browsers
  • QR code
  • video
  • ssl
  • clientScripts

Contributors

Originally created at Dutch National Police by

Developer Express Inc. (https://devexpress.com)

angular-testcafe's People

Contributors

adaskothebeast avatar aleksey28 avatar alexkamaev avatar alexskorkin avatar andreybelym avatar bayheck avatar bjeaurn avatar brian-courtois avatar dependabot[bot] avatar greenkeeper[bot] avatar hunhavoc avatar kirovboris avatar miherlosev avatar pavelmor25 avatar rkettelerij avatar robinsjovoll avatar testcafe-build-bot avatar timnederhoff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-testcafe's Issues

.testcaferc.json location in angular.json

Is it possible to create a property in schemas (f.e. configFilePath) to set up .testcaferc.json location instead of configure options separately.

It will be nice when you already have a .testcaferc.json and you don't want to describe everything again in angular.json file.

Another advantage is to have all configurations in one place.

Thanks in advance.

An in-range update of @angular-devkit/architect is breaking the build 🚨

The devDependency @angular-devkit/architect was updated from 0.803.2 to 0.803.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@angular-devkit/architect is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Release for Angular 13 support

Hi, I've noticed that in #79 the problem with the changed Schema was fixed. However, this fix was merged, it was never released.

Can we organize a new release?

Implement Schematic for updating angular.json

Please consider adding an Angular schematic to

  1. automatically update angular.json to use the TestCafe builder
  2. generate e2e example to help users get started

If support for ng-add is implemented, it'll help users adopt TestCafe more easily.

For reference, please check out the schematic for Protractor and WebdriverIO.

Once the schematic is available, we'll add TestCafe to the Angular CLI (see angular/angular-cli#20503). Please feel free to reach out if you have any questions!

Schema ID format is unsupported in Angular 13

Hi All,

with Angular 13 the angular-testcafe is not working anymore. Previously the keyword "id" for specifying schema ID was just deprecated, but now it became unsupported.

I'm opening a pull request with the new syntax that uses id$ to support Angular 13.

Add support for pageRequestTimeout

The pageRequestTimeout config was added in 1.11.0.

It is not part of the schema.json so I cannot use it without getting an errror.

We depend on it to test a legacy application which tends to load slowly.

Is it possible to add it ?

angular 14 Uncaught SyntaxError: cannot use `??` unparenthesized within `||` and `&&` expressions

What is your Scenario?

when running in angular 14 we get SyntaxError: cannot use ?? unparenthesized within || and && expressions

What is the Current behavior?

all test fail because of this error in hammerhead

What is the Expected behavior?

no error

What is your public website URL? (or attach your complete example)

cant share

What is your TestCafe test code?

fixture board tests
.page(E2eConstants.URL)
.beforeEach(async (t) => {
await t
.maximizeWindow() --> fails here
.useRole(roles.testUser)
await NavigationBL.navigateFromLoginToOverview();
})

Your complete configuration file

No response

Your complete test report

No response

Screenshots

No response

Steps to Reproduce

TestCafe version

1.19.0

Node.js version

16.15.1

Command-line arguments

set TESTCAFE_ENV=https://localhost:4200/ && testcafe chrome ./e2e/src/tests

Browser name(s) and version(s)

102.0 (64-bit), chrome 103.0.5060.66 (Official Build) (64-bit)

Platform(s) and version(s)

No response

Other

No response

Builder does not finish after tests run in Angular 14

After tests run (no matter if they pass or fail), execution doesn't halt in Angular 14. Cloning your project worked (Angular 13). Here is my configuration: { "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "newProjectRoot": "projects", "projects": { "usermgmt": { "projectType": "application", "schematics": { "@schematics/angular:component": { "style": "scss" }, "@schematics/angular:application": { "strict": true } }, "root": "", "sourceRoot": "src", "prefix": "app", "architect": { "build": { "builder": "ngx-build-plus:browser", "options": { "outputPath": "dist", "index": "src/index.html", "main": "src/main.ts", "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.app.json", "inlineStyleLanguage": "scss", "assets": [ "src/favicon.ico", "src/assets", "src/silent-refresh.html" ], "styles": ["src/styles.scss"], "scripts": [], "allowedCommonJsDependencies": ["color"], "extraWebpackConfig": "webpack.config.js", "commonChunk": false }, "configurations": { "production": { "budgets": [ { "type": "initial", "maximumWarning": "5mb", "maximumError": "5mb" }, { "type": "anyComponentStyle", "maximumWarning": "2kb", "maximumError": "4kb" } ], "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" } ], "outputHashing": "all", "extraWebpackConfig": "webpack.prod.config.js" }, "development": { "buildOptimizer": false, "optimization": false, "vendorChunk": true, "extractLicenses": false, "sourceMap": true, "namedChunks": true } }, "defaultConfiguration": "production" }, "serve": { "builder": "ngx-build-plus:dev-server", "configurations": { "production": { "browserTarget": "usermgmt:build:production", "extraWebpackConfig": "webpack.prod.config.js" }, "development": { "browserTarget": "usermgmt:build:development", "proxyConfig": "proxy.conf.json" } }, "defaultConfiguration": "development", "options": { "port": 4201, "publicHost": "http://localhost:4201", "extraWebpackConfig": "webpack.config.js" } }, "extract-i18n": { "builder": "ngx-build-plus:extract-i18n", "options": { "browserTarget": "usermgmt:build", "extraWebpackConfig": "webpack.config.js" } }, "test": { "builder": "@angular-devkit/build-angular:karma", "options": { "main": "src/test.ts", "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.spec.json", "karmaConfig": "karma.conf.js", "codeCoverage": true, "inlineStyleLanguage": "scss", "assets": ["src/favicon.ico", "src/assets"], "styles": ["src/styles.scss"], "scripts": [] } }, "e2e": { "builder": "angular-testcafe:testcafe", "options": { "devServerTarget": "usermgmt:serve", "browsers": ["chrome:headless --no-sandbox"], "src": ["e2e/*.ts"], "skipJsErrors": true, "reporters": [ { "name": "spec" }, { "name": "xunit", "output": "report.xml" } ] } } } } } }

An in-range update of @types/node is breaking the build 🚨

The devDependency @types/node was updated from 12.7.0 to 12.7.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

No Angular Server is started with ng e2e

ng e2e gives me the following warning message at Angular in version 12.1.2:
"TestcafeBuilderOptions" schema is using the keyword "id" which its support is deprecated. Use "$id" for schema ID.

No Angular Server is started. You have to start ng serve separately. No advantage currently visible with this library.

An Angular Schematic for this library would be really very helpful.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.