From 3ec535f72be4fea5c6afa129d40b81b74431f1d2 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 10 May 2021 13:56:26 +0200 Subject: [PATCH] Fix E2E tests --- client/e2e/src/po/video-upload.po.ts | 7 ++++++- server/middlewares/async.ts | 1 - server/tests/api/server/follow-constraints.ts | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/client/e2e/src/po/video-upload.po.ts b/client/e2e/src/po/video-upload.po.ts index 942025b6b..ad2acee7f 100644 --- a/client/e2e/src/po/video-upload.po.ts +++ b/client/e2e/src/po/video-upload.po.ts @@ -26,7 +26,12 @@ export class VideoUploadPage { await elem.sendKeys(fileToUpload) // Wait for the upload to finish - await browser.wait(browser.ExpectedConditions.elementToBeClickable(this.getSecondStepSubmitButton())) + await browser.wait(async () => { + const actionButton = this.getSecondStepSubmitButton().element(by.css('.action-button')) + + const klass = await actionButton.getAttribute('class') + return !klass.includes('disabled') + }) } async validSecondUploadStep (videoName: string) { diff --git a/server/middlewares/async.ts b/server/middlewares/async.ts index 0faa4fb8c..3d6e38809 100644 --- a/server/middlewares/async.ts +++ b/server/middlewares/async.ts @@ -3,7 +3,6 @@ import { NextFunction, Request, RequestHandler, Response } from 'express' import { ValidationChain } from 'express-validator' import { ExpressPromiseHandler } from '@server/types/express' import { retryTransactionWrapper } from '../helpers/database-utils' -import { HttpMethod, HttpStatusCode } from '@shared/core-utils' // Syntactic sugar to avoid try/catch in express controllers // Thanks: https://medium.com/@Abazhenov/using-async-await-in-express-with-node-8-b8af872c0016 diff --git a/server/tests/api/server/follow-constraints.ts b/server/tests/api/server/follow-constraints.ts index 0846b04f4..8a91fbba3 100644 --- a/server/tests/api/server/follow-constraints.ts +++ b/server/tests/api/server/follow-constraints.ts @@ -28,7 +28,7 @@ describe('Test follow constraints', function () { let userAccessToken: string before(async function () { - this.timeout(60000) + this.timeout(90000) servers = await flushAndRunMultipleServers(2)