Buttons

Steps:
  1. Click on the Click me button
  2. Assert the text element Surprise is now displayed
Steps:
  1. Assert the disabled attribute from the Disabled button
Steps:
  1. Click the Submit button
  2. Assert the loader is present and that the button is disabled while the loader is present
Steps:
  1. Click the Tooltip button
  2. Assert the header and body text of the tooltip
Steps:
  1. Get the border and background colors of the Color button
  2. Hover the button and get the new colors
  3. Assert that the new background color is not equal to the old one
describe('button tests', () => {
  
  beforeEach(() => {
    cy.visit('http://www.autoprac.co.uk/exercise/buttons')
  })

  it('assert button goes home and can navigate back', () => {
    cy.getById('ClickBtn').click()
    cy.getById('shownText').contains('Surprise!')
  })

  it('assert button size', () => {
    cy.getById('ClickBtn').then(($button) => {
      const buttonSize = $button[0].getBoundingClientRect()
      const width = buttonSize.width;
      
      expect(width).to.eq(100)
    })
  })

  it('assert button is disabled', () => {
    cy.getById('DisabledBtn')
      .should('be.disabled')
  })

  it('assert tooltip is displayed', () => {
    cy.clickById('TooltipBtn')
    cy.get('.popover-header')
      .contains('This is the title')
    cy.get('.popover-body')
      .contains('The text to this popup')
  })
})
class Test
{
    public void Test()
    {
        var x = new Webdriver();
    }
}
import { test, expect } from '@playwright/test';

test('basic test', async ({ page }) => {
  await page.goto('https://playwright.dev/');
  const name = await page.innerText('.navbar__title');
  expect(name).toBe('Playwright');
});