This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const uaParser = require('ua-parser-js'); | |
| const playwright = require('playwright'); | |
| const expect = require('chai').expect; | |
| let userAgentInfo; | |
| let browser; | |
| describe('Test browser information', () => { | |
| before(async () => { | |
| browser = await playwright['chromium'].launch(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| node { | |
| TESTCAFE_DOCKER_PATH = 'docker/Dockerfile' | |
| } | |
| pipeline { | |
| agent { | |
| dockerfile { | |
| filename "${TESTCAFE_DOCKER_PATH}" | |
| args '--net=host -e DISPLAY=":0"' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM testcafe/testcafe | |
| # See https://github.com/DevExpress/testcafe/tree/master/docker | |
| # We need root privileages to install new deps: | |
| USER root | |
| ENV LANG C.UTF-8 | |
| # add a simple script that can auto-detect the appropriate JAVA_HOME value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe('It should validate cypress react selector', () => { | |
| before(() => { | |
| cy.visit('https://ahfarmer.github.io/calculator/'); | |
| cy.waitForReact(); | |
| }); | |
| it('should calculate 7 * 6', () => { | |
| cy.react('t', { name: '7' }).click(); | |
| cy.react('t', { name: 'x' }).click(); | |
| cy.react('t', { name: '6' }).click(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <reference types="cypress" /> | |
| import 'cypress-react-selector' | |
| import { mount } from 'cypress-react-unit-test' | |
| import React from 'react' | |
| import ProductsList from './ProductsList.jsx' | |
| // test similar to | |
| // https://github.com/softchris/react-book/blob/7bd767bb39f59977b107d07f383a8f4e32a12857/Testing/test-demo/src/Components/__tests__/ProductsList.js | |
| it('renders without crashing', () => { | |
| cy.stub(window, 'fetch') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react' | |
| import { getProducts } from '../products' | |
| class AProduct extends React.Component { | |
| constructor(props) { | |
| super(props) | |
| this.state = { | |
| name: props.name, | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| before(() => { | |
| cy.visit('/'); | |
| cy.waitForReact(); | |
| }); | |
| it('enter data into the fields', () => { | |
| cy.react('MyTextInput', { field: { name: 'email' } }).type('bugs.bunny@test.com'); | |
| cy.react('MyTextInput', { field: { name: 'password' } }).type('SUPER SECRET STUFFZ'); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useState } from "react"; | |
| import { Formik, Field, Form, ErrorMessage } from "formik"; | |
| const MyTextInput = (props) => { | |
| const { field, type } = props; | |
| return <input {...field} type={type} placeholder={field.name} />; | |
| }; | |
| function App() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useState } from "react"; | |
| import { Formik, Field, Form, ErrorMessage } from "formik"; | |
| const MyTextInput = (props) => { | |
| const { field, type } = props; | |
| return <input {...field} type={type} placeholder={field.name} />; | |
| }; | |
| function App() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface Chainable { | |
| /** | |
| * Get react elements by component, props and states | |
| * @see https://github.com/abhinaba-ghosh/cypress-react-selector/blob/master/cypress/integration/react-selector.spec.js | |
| * @example | |
| * cy.react(`MyComponent`).should('have.length', 10) | |
| * cy.react('MyComponent',{name:'Bill'}).should('have.length', 1) | |
| */ | |
| react(component: string, props?: {}, state?: {}): Chainable<any>; |
NewerOlder