Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
dmtrKovalenko committed Dec 2, 2021
2 parents ea1b4e6 + 6272601 commit 0112a49
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions cypress/fixtures/type-test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!doctype html>
<html>
<body>
<main>
<input name="q" type="text" placeholder="Testing type" />
<button>test button</button>
</main>
</body>
</html>

6 changes: 4 additions & 2 deletions cypress/integration/type.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
describe("cy.realType", () => {
beforeEach(() => {
cy.visit("https://google.com?hl=en");
cy.visit("./cypress/fixtures/type-test.html");
cy.get("input[name=q]").focus()
});

it("types text into googles main search inptu", () => {
cy.realType("cypress can produce real events");

cy.get("input[name=q]").should(
"have.value",
"cypress can produce real events"
Expand All @@ -13,12 +15,12 @@ describe("cy.realType", () => {

it("does not type if element is not focused", () => {
cy.realPress("Tab"); // move focus out
cy.get("input[name=q]").should('not.be.focused');
cy.realType("pressing keys");
cy.get("input[name=q]").should("have.value", "");
});

it("supports cypress's keys shortcuts", () => {
cy.get("input[name=q]").focus()
cy.realType("Something{backspace}{backspace}")
cy.get("input[name=q]").should("have.value", "Somethi");
})
Expand Down

0 comments on commit 0112a49

Please sign in to comment.