Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syn 1.0 #183

Open
justinbmeyer opened this issue Mar 13, 2021 · 0 comments
Open

Syn 1.0 #183

justinbmeyer opened this issue Mar 13, 2021 · 0 comments

Comments

@justinbmeyer
Copy link
Member

I've started developing a syn 1.0. The goals:

  1. Make the syntax easier to use in modern browsers.
  2. Clean up the code
  3. Pave the way for mobile tests (pointer events)

Make the syntax easier to use in modern browsers

Syn is callback-based, this makes it cumbersome to test sequential behaviors:

it("does something after 2 clicks", function(){
  syn.click("foo", function(){
    syn.click("bar", function(){
      // CHECK SOMETHING HERE
    })
  })
})

If syn returned promises, this can get cleaned up quite a bit:

it("does something after 2 clicks", async function(){
  await syn.click("foo");
  await syn.click("bar");
  // CHECK SOMETHING HERE
})

Finally, syn works with element ids, not CSS selectors (CSS selectors were not widely supported when it was first created). I'd like to change that:

it("does something after 2 clicks", async function(){
  await syn.click(".foo");
  await syn.click("#bar");
  // CHECK SOMETHING HERE
})

I think these 2 changes will make syn much easier to use on its own. I'd also like to make syn a single ES module so it can be easily imported into any app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant