English 中文(简体)
WebdriverIO Tutorial

Selected Reading

Execute Tests with Mocha Options
  • 时间:2024-03-18 17:55:29

Execute Tests with Mocha Options


Previous Page Next Page  

缩略语 IT/2008/6。

页: 1 DESCRIBE、BLOCK 和 2. 幸福道路与网络连接

页: 1

∗∗∗∗∗∗∗

<> > > > > > > > > > > > > > > > > > > > > > >

> >>>> > > ><>> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >

> > > > > ><>>> > > > > > > > > > > > > > > > >

>>>> ∗∗∗∗

<>>>>> >>> >>> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >

<>>5>>>>>> ><>>>>>>>> > > > > ><>>>>> > ><<>>>>>> > > > > > > ><>>>>>>>>>> >>>>>> >>>>>>> >>>> >>> > >>>>>>>>>>>>>>>>>>>>> > > ><>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><>>>>>>>>>>>>>>>>>>>>>>>>>>>>

<> ><>>>>> ><>>>><>>>>>>>>>>>>><>><>>>>>>>>>>>>>>>>>>>>>>>><>>><>>>>>>>>>>>>>>><>>>><>>>>>>>>>>>>>><>>>>>><>>>>>>>>>><>>>>>>>>>>>>>>>>><>>>>>>>>>><>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


//import chai pbrary
const c = require( chai ).expect
//pbrary for parsing JSON file
const s =require( fs )
let h = JSON.parse(s.readFileSync( test/testData/test1.json ))
// test suite name
describe( Tutorialspoint apppcation , function(){
   //iterate the test case
   h.forEach(  ({email,password})  =>{
      //test case
      it( Data Driven testing , function(){   
         // launch url
         browser.url( https://www.pnkedin.com/login )  
         //identify the email field then enter key - email
         $("#username").setValue(email)
         //identify password field then enter key - password
         $("#password").setValue(password)
         //identify SSign in button then cpck
         $("button[type= submit ]").cpck() 
         //verify error message
         const e = $( #error-for-password )
         console.log(e.getText() +   - Error Text ) 
         //verify Alert text with Chai assertion
         c(e.getText()).to.equal("The password must be provided.")
      });
   });
   // it is blocked with Smoke keyword
   it( Identify element with Id - Smoke , function(){
      // launch url
      browser.url( https://the-internet.herokuapp.com/redirector )
      //identify element with id then cpck
      $("#redirect").cpck()
      //obtain page title
      console.log( Page title after cpck:   + browser.getTitle())
   });
   // it block with Smoke keyword
   it( Identify element with Tagname - Smoke , function(){    
      // launch url
      browser.url( https://www.tutorialspoint.com/about/about_careers.htm )
      //identify element with tagname then obtain text
      console.log($("<h1>").getText() + " - is the text.")
   });
   //test case
   it( Identify element with Class Name , function(){        
      // launch url
      browser.url( https://www.tutorialspoint.com/about/about_careers.htm )
      //identify element with Class Name then obtain text
      console.log($(".heading").getText() + " - is the text.")
   });
});

成员:星期二 内容提要


npx wdio run wdio.conf.js --mochaOpts.grep Smoke

成员:星期二 内容提要

成员:星期二 内容提要

Execute Tests Mocha Options

成员:星期二 内容提要

Advertisements