aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/e2e/src/suites-local/custom-server-defaults.e2e-spec.ts
blob: c2c8edcc91ffe5df2c85af885e8242b1fbef58a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { LoginPage } from '../po/login.po'
import { VideoUploadPage } from '../po/video-upload.po'
import { VideoWatchPage } from '../po/video-watch.po'
import { isMobileDevice, isSafari, waitServerUp } from '../utils'

describe('Custom server defaults', () => {
  let videoUploadPage: VideoUploadPage
  let loginPage: LoginPage
  let videoWatchPage: VideoWatchPage

  before(async () => {
    await waitServerUp()
  })

  beforeEach(async () => {
    loginPage = new LoginPage()
    videoUploadPage = new VideoUploadPage()
    videoWatchPage = new VideoWatchPage(isMobileDevice(), isSafari())

    await browser.maximizeWindow()
  })

  it('Should upload a video with custom default values', async function () {
    await loginPage.loginAsRootUser()
    await videoUploadPage.navigateTo()
    await videoUploadPage.uploadVideo()
    await videoUploadPage.validSecondUploadStep('video')

    await videoWatchPage.waitWatchVideoName('video')

    expect(await videoWatchPage.getPrivacy()).toBe('Internal')
    expect(await videoWatchPage.getLicence()).toBe('Attribution - Non Commercial')
    expect(await videoWatchPage.isDownloadEnabled()).toBeFalsy()
    expect(await videoWatchPage.areCommentsEnabled()).toBeFalsy()
  })

})