Steps:
- Click on the Click me button
- Assert the text element Surprise is now displayed
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');
});