fixture data won't able to read

Viewed 21
/// <reference types="cypress" />

describe(' My first fixtures', function(){ 

                    before(function(){
                        //access fixture data
                        cy.fixture('example').then(function(data){
                            
                           this.data=data
                    })

        })
    
        it('FixturesDemoTest',function()
        
         {

            cy.visit('https://demo.nopcommerce.com/login')
            cy.wait(3000)
            cy.get('#Email').type('this.data.email')
            cy.get('#Password').type('this.data.password')
            cy.get('form > .buttons > .button-1').click()

        })

})

in the email and password field it will input "this.data.email and this.data.password

In my example.json this is the content:

{

   "email": "marklowell123@gmail.com",
   "password": "Godisgood123"

}
0 Answers
Related