Skip to content
Snippets Groups Projects
Select Git revision
  • f3f745d51fd272d246459338640aecfd4cf7289e
  • master default
  • fix-bibtex-unicode-filter
  • dataspy-hacking
4 results

nantes.md

Blame
  • peer1.e2e.js 880 B
    import { Selector } from "testcafe"
    
    const host = "127.0.0.1"
    const port = process.env.PORT || 3000
    
    fixture`Peer 1`.page`${host}:${port}`
    
    const idAppearTimeout = 1000
    const syncTimeout = 5000
    const selectorOptions = { timeout: 1000 }
    
    test("Connection id appears", async (t) => {
      const userId = async () =>
        await Selector("#user-avatar")
          .child(1)
          .addCustomDOMProperties({ innerHTML: (el) => el.innerHTML })
          .with(selectorOptions).innerHTML
    
      await t
        .wait(idAppearTimeout)
        .expect((await userId()).length)
        .gt(0)
    })
    
    test("Clicking and dragging on canvas creates a single child element", async (t) => {
      const canvas = Selector("#canvas").with(selectorOptions)
    
      await t
        .drag(canvas, 10, 10)
        .wait(syncTimeout)
        .expect(canvas.childElementCount)
        // first draw also creates last recognised path placeholder
        .eql(2)
    })