aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/e2e/src/commands/upload.ts
blob: 05d3f8f31c6988d7379f4b97be0f4cb844a61377 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                                                                           
browser.addCommand('chooseFile', async function (this: WebdriverIO.Element, localFilePath: string) {
  try {
    const remoteFile = await browser.uploadFile(localFilePath)

    return this.addValue(remoteFile)
  } catch {
    console.log('Cannot upload file, fallback to add value.')

    // Firefox does not support upload file, but if we're running the test in local we don't really need it
    return this.addValue(localFilePath)
  }
}, true)