I am struggling with implementing soft assertions in my Cypress test. I need to convert all the assertions to soft assertions. The problem I encounter is that I cannot locate the element in the jsonAssertion. For example cy.get('span[class="h4"]') is the element and I need to assert that it contains some text. How can this be done with jsonAssertion.softAssert()?
This is my test:
describe('Load Validation Test', function(){
const jsonAssertion = require("soft-assert")
it('Load Validation Test', function(){
let url = Cypress.config().baseUrl
cy.visit(url+'activityTaskManagement')
cy.get('span[class="h4"]').should('contain.text','Manage Activities')
cy.get('button[ng-click="vm.addActivityTask();"]').should('be.visible')
cy.get('button[ng-click="vm.addActivityTaskBulk();"]').should('be.visible')
cy.get('input[placeholder="Activity Name"]').should('be.visible')
cy.get('div table[class="table table-striped b-t b-light table-nowrap"]').should('be.visible')
})
})