Code Monkey home page Code Monkey logo

testcafe-browser-tools's Introduction

testcafe-browser-tools

Build Status

TestСafe Browser Tools is an utility library for performing platform-dependent actions on browser windows. Working with browsers is specific for each operating system and requires native code to deal with. In order to provide painless and simple installation, this package encapsulates pre-built binaries for all supported platforms and JS-wrappers around them. This helps end-users avoid running post-npm-install build actions.  

Build Process

To build native binaries from source files, execute the gulp task corresponding to your operating system:

'buildWin'
'buildMac'
'buildLinux'

Important note: The application for a particular platform must be built on a machine with the same platform. Since this package can be used on old OS version such as NodeJS 16 docker container, it is important to build binaries on the old OS version for the binaries to contain corresponding dependencies(for example glibc-2.31 for node16 docker image).

The bin directory contains pre-built native binaries. Consider using them if your contribution does not affect the native modules.

Install

$ npm install testcafe-browser-tools

API Reference

Important note: To identify the web browser window, most of the provided functions use its title. This title matches the web page's document.title in most of the browsers. However, Microsoft Edge truncates the window title to the hostname if document.title contains only a URL ( e.g. document.title = 'http://localhost:1337/page' gives localhost in the window title).

So, you need to add some characters before the URL in order to bring it to the window title:

document.title = 'title: ' + document.location.toString()

For API reference, see the API document.

Testing

To run automated tests:

$ npm test

Since the module functionality depends on browsers available on a testing machine and you cannot predict expected returned values for some functions, the automated tests cover only a part of the functionality. To test all the functions provided by the module, use the playground. To run it, execute the gulp task corresponding to your operating system:

$ gulp runPlaygroundWin
$ gulp runPlaygroundMac
$ gulp runPlaygroundLinux

This will open the Playground web page at http://localhost:1334/, where you can manually check if the functions work correctly.

Author

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

testcafe-browser-tools's People

Contributors

aleks-pro avatar aleksey28 avatar alexandermoskovkin avatar alexey-lin avatar alexkamaev avatar andreybelym avatar artem-babich avatar churkin avatar dcsaszar avatar deltaevo avatar dmitry-ostashev avatar farfurix avatar inikulin avatar kirovboris avatar kisrefod avatar margaritaloseva avatar miherlosev avatar ogurecher avatar pgorny avatar superroma avatar vasilystrelyaev avatar wentwrong avatar

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.