mirror of
https://git.cloudron.io/cloudron/peertube-app.git
synced 2024-12-22 08:07:22 +00:00
Fix tests
This commit is contained in:
parent
f97551091d
commit
6f63008dd3
1 changed files with 7 additions and 6 deletions
13
test/test.js
13
test/test.js
|
@ -19,8 +19,6 @@ const execSync = require('child_process').execSync,
|
|||
{ Builder, By, Key, until } = require('selenium-webdriver'),
|
||||
{ Options } = require('selenium-webdriver/chrome');
|
||||
|
||||
const rl = readlinePromises.createInterface({ input: process.stdin, output: process.stdout });
|
||||
|
||||
if (!process.env.USERNAME || !process.env.PASSWORD || !process.env.EMAIL) {
|
||||
console.log('USERNAME, EMAIL and PASSWORD env vars need to be set');
|
||||
process.exit(1);
|
||||
|
@ -131,16 +129,19 @@ describe('Application life cycle test', function () {
|
|||
if (error) return; // sometimes it doesn't appear, maybe it's cached in local storage
|
||||
await browser.findElement(By.xpath('//a[contains(text(), "Configure my instance")]')).click(); // this opens a new window
|
||||
|
||||
let say_cmd = await getOS() == "Darwin" ? "say" : "spd-say";
|
||||
const say_cmd = await getOS() == "Darwin" ? "say" : "spd-say";
|
||||
execSync(`${say_cmd} "Close the newly opened configuration tab."`);
|
||||
|
||||
const rl = readlinePromises.createInterface({ input: process.stdin, output: process.stdout });
|
||||
await rl.question('Is tab closed? ');
|
||||
}
|
||||
|
||||
async function uploadVideo() {
|
||||
browser.get('https://' + app.fqdn + '/videos/upload');
|
||||
await browser.sleep(2000);
|
||||
await browser.findElement(By.xpath('//input[@id="videofile" and @type="file"]')).sendKeys(path.resolve(__dirname, './Cloudron Test Video.mp4'));
|
||||
await browser.get(`https://${app.fqdn}/videos/upload#upload`);
|
||||
await browser.sleep(3000);
|
||||
await browser.wait(until.elementLocated(By.id('videofile')), TEST_TIMEOUT); // do not do element visible check . it fails, no clue why
|
||||
await browser.findElement(By.id('videofile')).sendKeys(path.resolve(__dirname, './Cloudron Test Video.mp4'));
|
||||
console.log('waiting 10 seconds for upload');
|
||||
await browser.sleep(10000); // wait for upload
|
||||
|
||||
await waitForElement(By.xpath('//div[@class="submit-container"]//span[text()="Publish"]'));
|
||||
|
|
Loading…
Reference in a new issue