Posts

Print the const in TestCafe

will console.log(<const>) ; Works inside t test controller.

Miscellaneous

Fixture does not use ' but uses ` Selector in testcafe uses CSS selector For comments we use double quotes

Commands, Methods, Keywords and Syntax examples

https://devexpress.github.io/testcafe/documentation/test-api/actions/ typeText click Selector('.classname').find('h1'); <const>.innerText expect(Selector('#<id>').innerText).eql('Thank you,John Smith!'); fixture `My fixture` . page `http://www.example.com/` ; . setNativeDialogHandler ( () => true ) const location = await t . eval ( () => window . location ); await t . expect ( location . pathname ). eql ( ' /testcafe/example/thank-you.html ' ); const sometext = await Selector ( '#main-form > div > div.row > div.column.col-1 > fieldset:nth-child(1) > legend' ). innerText ; -- will this work npx testcafe chrome SampleTest.js -- to run specific javascript file

How is TestCafe different from other web automation tools

Command to trigger script: testcafe chrome test1.js So we do not need to install Chrome driver separately

Steps to use Testcafe

Have nodejs and npm installed on your machine use npm install testcafe command to install testcafe on your machine Using Selector library you will be able to test web application Create ,js file Use command to import selector from testcafe Use fixture to describe test and simultaneously you could mention url to launch in the same command Use test function - test( testName, fn(t) ) fixture `MyFixture` ; test ( ' Test1 ' , async t => { /* Test 1 Code */ }); test ( ' Test2 ' , async t => { /* Test 2 Code */ });

reference urls

https://devexpress.github.io/testcafe/ https://devexpress.github.io/testcafe/documentation/getting-started/ https://devexpress.github.io/testcafe/documentation/test-api/actions/    ---- methods test api used by t test controller https://www.w3schools.com/cssref/css_selectors.asp     ... CSS selector https://yizeng.me/2014/03/23/evaluate-and-validate-xpath-css-selectors-in-chrome-developer-tools/    ---  CSS selector validator https://youtu.be/i5-EUAIcxLA ....for E2E testing testcafe javascript https://youtu.be/2foHDNkVkFA ..... For Pom model using testcafe javascript https://www.youtube.com/watch?v=hstyq-rtRXA ...... For Flow diagram flow charts testcafe javascript https://testcafe-discuss.devexpress.com/t/how-to-use-const-value-in-another-test/799 https://devexpress.github.io/testcafe/documentation/guides/concepts/page-model.html#step-1---declare-a-page-model-class     -- POM on test cafe