QA job
Manual QA
Automation QA
Manual QA tools
Automation testing tools
WebApps
What is Quality
Quality is defined as the product or services that should be "fit for use and purpose."
Quality is all about meeting the needs and expectations of customers concerning functionality, design, reliability, durability, and price of the product.
SDLC vs STLC (refers to a testing process which has specific steps to be executed in a definite sequence to ensure that the quality goals have been met.)
The team
How did it work
How does it work
Test plan document
Manual testing
How to manually test
Locators
IDs are the unique attributes given to the HTML elements that can be identified and updated with minimal effort. The ID attribute is unique across the DOM, due to which it is the fastest way for locating the required WebElement. It also helps in accelerating the interactions with the underlying elements in the DOM.
Here, <ul> tag can be identified uniquely with CSS selectors command using $(‘#lists’).
Here, <ul> tag can be identified uniquely with CSS selectors command using $(‘#lists’).
Unique ID -
describe('Cypress Locators in action', ()=>{
beforeEach(()=>{
cy.visit('http://automationpractice.com')
})
it('Interact with Elements using ID selector', ()=>{
cy.get('#search_query_top') //ids are identified using # prefix
.type('Dress')
.type('{enter}')
.get('#center_column')
.should('be.visible')
})
})
Dynamic ID - http://www.uitestingplayground.com/
The HTML name attribute is mostly used by <form>,<button>, <input> tags
Syntax of the NAME locator in Cypress: cy.get(<tag>[name='value']) where <tag> can be HTML tags like input, form, etc. <tag> is optional, when not specified, it will match name against all the tags (wherever match is found).
it('Interact with Elements using name attribute',()=>{
cy.get('input[name="search_query"]') //observe how we use name attribute
.type('Tshirt{enter}')
Attributes are ways to set a particular property of the HTML element. They also help define the behavior of the elements when a specific condition is set and triggered.
syntax to use attributes in Cypress:
describe('Cypress Locators in action', ()=>{
beforeEach(()=>{
cy.visit('http://automationpractice.com')
})
it('Interact with Elements using class selector',()=>{
cy.get('.item')
.eq(0) //0th element in the array of elements
.click()
cy.get('[class*="center_column"]')
.should('be.visible')
})
it('Class selector short hand',()=>{
//find class containing value .. using *=
cy.get("a[class*='add_to_cart']")
.eq(0) // finding 0th element
.click()
.get("#layer_cart")
.should('be.visible')
//find class value that start with .. using ^=
cy.get("[class^='layer_cart_product']")
.should('be.visible')
.get("a[title='Proceed to checkout']")
.click()
//find class that ends with... using $=
cy.get('[class$="_delete"]')
.click()
.get('.alert')
.should('be.visible')
})
})
it('Interact with links or button using partial text',()=>{
cy.get('a:contains("My orders")') // similar to partial link text
.click()
cy.get('.page-heading')
.should('have.text','Authentication')
})
Assertions
describe('Implicit Assertions', () => {
it('.should() - make an assertion about the current subject', () => {
cy.visit('https://demoqa.com/automation-practice-table/')
cy.get('.tsc_table_s13')
.find('tbody tr:last')
.should('have.class', 'odd')
.find('td')
.first()
// checking the text of the <td> element in various ways
.should('have.text', 'China')
.should('contain', 'China')
.should('have.html', 'China')
.should('match', 'td')
// Checking whether the text matches the regular expression
// Here, first we have invoked the jQuery method text()
// and then validated it using the regular expression
.invoke('text')
.should('match', /China/i)
})
it('.and() - chain multiple assertions together', () => {
cy.get('#sidebar')
.should('have.class', 'widget-area')
.and('have.attr', 'role')
.and('include', 'complementary')
})
})