mardi 29 septembre 2020

testCafe slowing the tests down after fileUpload

I am automating a data capture form. The first element of this form is an image file upload control & I'm uploading a 5KB image. But after this step, the test executes the next step which is writing a text into a textbox & then it halts for nearly 30 seconds. How to reduce this un-necessary wait?

    test('Test 1', async t => {
  await listingPage.uploadImage();
  await listingPage.listAnItem();
  ..

Upload image code

  async uploadImage() {
    await t.setFilesToUpload(this.imageInput, ['../../uploads/photo02.jpg']);
  }

** Data entry code block **

async listAnItem() {
    await t
      .typeText(Selector('#description'), this.DESCRIPTION) /* --> Application is slowing after this step */
      .click(this.categorySelect)
      .click(Selector('#react-select-2-option-0-0'))

.testcaferc.json file

{
    "browsers": [ "chrome", "safari" ],
    "remoteChromeVersion": "80",
    "src": "specs",
    "reporter": [
      {
        "name": "spec"
      }
    ],
    "speed": 1,
    "debugOnFail": false,
    "skipJsErrors": true,
    "selectorTimeout": 20000,
    "assertionTimeout": 20000,
    "pageLoadTimeout": 8000
  }

DOM Snippet of file-upload

<input aria-describedby="error__images" aria-label="Upload an image" tabindex="0" type="file" multiple="" accept="image/jpeg, image/png" data-testid="imageInput" class="ImageInputstyles__Input-sc-2l692w-7 aosWu">

Aucun commentaire:

Enregistrer un commentaire