Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
"isEnabled": true,
"url": "/api/health"
},
"heroku-demo": {
"isEnabled": true,
"url": "/api/health"
},
"no-create-account": {
"isEnabled": true,
"url": "/api/health"
Expand Down
48 changes: 48 additions & 0 deletions starsky-tools/end2end/cypress/e2e.bak/00-warmup/warmup.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { envName, envFolder } from '../../support/commands'
import configFile from './config.json'
const config = configFile[envFolder][envName]

describe('Warmup', () => {
it('Warmup before starting', () => {
if (!config.isEnabled) return false
retry()
})

function retry (count = 0) {
cy.request({
failOnStatusCode: false,
retryOnNetworkFailure: true,
url: config.url,
timeout: 60000
}).then((response) => {
if (response.status === 200 || response.status === 401) {
return
}
count++
if (count < 15) {
cy.wait(400)
retry(count)
return
}
throw new Error(response.body)
})
}

it('ignore loca.lt warning', () => {
if (!config.isEnabled) return false

cy.request({
failOnStatusCode: false,
url: config.url
}).then((status) => {
if (status.status !== 401) {
return
}
cy.visit({
failOnStatusCode: false,
url: config.url
})
cy.get('.btn-primary').click()
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
"url": "/account/login?ReturnUrl=%2F%3Ff%3D%2F&fromLogout=true",
"successUrl" : "/?f=/"
},
"heroku-demo" : {
"isEnabled": true,
"url": "/account/login?ReturnUrl=%2F%3Ff%3D%2F&fromLogout=true",
"successUrl" : "/?f=/"
},
"no-create-account" : {
"isEnabled": true,
"url": "/account/login?ReturnUrl=%2F%3Ff%3D%2F&fromLogout=true",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
"successUrl" : "/account/login",
"statusApi": "/starsky/api/account/status"
},
"heroku-demo" : {
"isEnabled": true,
"url": "/account/login?ReturnUrl=/",
"successUrl" : "/account/login",
"statusApi": "/starsky/api/account/status"
},
"no-create-account": {
"isEnabled": true,
"url": "/account/login?ReturnUrl=/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
"isEnabled": true,
"url": "/?f=/"
},
"heroku-demo" : {
"isEnabled": true,
"url": "/?f=/"
},
"no-create-account" : {
"isEnabled": true,
"url": "/?f=/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,10 @@
"updateApi": "/api/update",
"indexApi": "/api/index",
"notificationApi": "/api/notification/notification?dateTime=1",
"realtime": "/starsky/realtime"
},
"heroku-demo" : {
"isEnabled": true,
"url": "/?f=/starsky-end2end-test",
"mkdirName": "starsky-end2end-test",
"mkdirPath": "/starsky-end2end-test",
"urlMkdir": "/api/index/?f=/starsky-end2end-test",
"updateApi": "/api/update",
"indexApi": "/api/index",
"notificationApi": "/api/notification/notification?dateTime=1",
"realtime": "/starsky/realtime"
"realtime": "/starsky/realtime",
"urlApiCollectionsFalse": "/api/index/?f=/starsky-end2end-test&collections=false",
"searchClearCache": "/api/search/remove-cache?t=-isDirectory:true -filepath=/starsky-end2end-test",
"checkIfDirExistApi": "/starsky/api/search?json=true&t=-isDirectory:true -filepath=/starsky-end2end-test&p=0"
},
"no-create-account": {
"isEnabled": true,
Expand All @@ -31,7 +23,10 @@
"updateApi": "/api/update",
"indexApi": "/api/index",
"notificationApi": "/api/notification/notification?dateTime=1",
"realtime": "/starsky/realtime"
"realtime": "/starsky/realtime",
"urlApiCollectionsFalse": "/api/index/?f=/starsky-end2end-test&collections=false",
"searchClearCache": "/api/search/remove-cache?t=-isDirectory:true -filepath=/starsky-end2end-test",
"checkIfDirExistApi": "/starsky/api/search?json=true&t=-isDirectory:true -filepath=/starsky-end2end-test&p=0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { envName, envFolder } from '../../support/commands'
import configFile from './config.json'
import flow from './flow.json'
const config = configFile[envFolder][envName]
import { checkIfExistAndCreate, waitOnUploadIsDone } from "../helpers/create-directory-helper.cy";

describe('Archive (from upload) (21)', () => {
beforeEach('Check some config settings and do them before each test (21)', () => {
Expand All @@ -26,6 +27,32 @@ describe('Archive (from upload) (21)', () => {
})
})

const fileName2 = "20200822_111408.jpg";
const fileName1 = "20200822_112430.jpg";
const fileName3 = "20200822_134151.jpg";
const fileName4 = "20200822_134151.mp4";

it("clear cache & upload all files that are needed in background (21)", () => {
// clean trash
cy.request({
failOnStatusCode: false,
method: "DELETE",
url: "/starsky/api/delete",
qs: {
f: `/starsky-end2end-test/${fileName1};/starsky-end2end-test/${fileName2};/starsky-end2end-test/${fileName3};/starsky-end2end-test/${fileName4}`,
},
});
cy.wait(500);

checkIfExistAndCreate(config);

cy.fileRequest(fileName4, "/starsky-end2end-test", "image/jpeg");
cy.fileRequest(fileName1, "/starsky-end2end-test", "image/jpeg");
cy.fileRequest(fileName2, "/starsky-end2end-test", "image/jpeg");
cy.fileRequest(fileName3, "/starsky-end2end-test", "image/jpeg");
waitOnUploadIsDone(config.urlApiCollectionsFalse, 0);
});

it('Check if folder is there (21)', () => {
if (!config.isEnabled) return
cy.visit(config.url)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,6 @@
"apiEnvEndpoint": "/starsky/api/env",
"apiMoveToTrash": "/starsky/api/trash/move-to-trash"
},
"heroku-demo" : {
"isEnabled": true,
"url": "/?f=/starsky-end2end-test",
"mkdirName": "starsky-end2end-test",
"mkdirPath": "/starsky-end2end-test",
"urlMkdir": "/api/index/?f=/starsky-end2end-test",
"mkdirApi": "/api/disk/mkdir",
"searchClearCache": "/api/search/remove-cache?t=-isDirectory:true -filepath=/starsky-end2end-test",
"checkIfDirExistApi": "/starsky/api/search?json=true&t=-isDirectory:true -filepath=/starsky-end2end-test&p=0",
"successUrl" : "/?f=/",
"trash": "/trash",
"apiTrash": "/api/search/trash",
"apiMkdir": "/starsky/api/disk/mkdir",
"apiUpdate": "/starsky/api/update",
"apiRename": "/starsky/api/disk/rename",
"apiEnvEndpoint": "/starsky/api/env",
"apiMoveToTrash": "/starsky/api/trash/move-to-trash"
},
"no-create-account" : {
"isEnabled": true,
"url": "/?f=/starsky-end2end-test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@
"searchClearCache": "/api/search/remove-cache?t=-inurl:starsky-end2end-test -imageformat:jpg",
"clearCacheApi": "/api/remove-cache?f=/starsky-end2end-test"
},
"heroku-demo" : {
"isEnabled": true,
"url": "/search",
"urlSearchJpg": "/search?t=-imageformat:jpg",
"urlSearchFromUpload": "/search?t=-inurl:starsky-end2end-test -imageformat:jpg",
"searchClearCache": "/api/search/remove-cache?t=-inurl:starsky-end2end-test -imageformat:jpg",
"clearCacheApi": "/api/remove-cache?f=/starsky-end2end-test"
},
"no-create-account" : {
"isEnabled": true,
"url": "/search",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,16 @@
"url": "/?f=/starsky-end2end-test",
"mkdirName": "starsky-end2end-test",
"mkdirPath": "/starsky-end2end-test",
"urlMkdir": "/api/index/?f=/starsky-end2end-test"
},
"heroku-demo" : {
"isEnabled": true,
"url": "/?f=/starsky-end2end-test",
"mkdirName": "starsky-end2end-test",
"mkdirPath": "/starsky-end2end-test",
"urlMkdir": "/api/index/?f=/starsky-end2end-test"
"urlMkdir": "/api/index/?f=/starsky-end2end-test",
"urlApiCollectionsFalse": "/api/index/?f=/starsky-end2end-test&collections=false"
},
"no-create-account":{
"isEnabled": true,
"url": "/?f=/starsky-end2end-test",
"mkdirName": "starsky-end2end-test",
"mkdirPath": "/starsky-end2end-test",
"urlMkdir": "/api/index/?f=/starsky-end2end-test"
"urlMkdir": "/api/index/?f=/starsky-end2end-test",
"urlApiCollectionsFalse": "/api/index/?f=/starsky-end2end-test&collections=false"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { waitOnUploadIsDone } from 'e2e/helpers/create-directory-helper.cy'
import { envName, envFolder } from '../../support/commands'
import configFile from './config.json'
import flow from './flow.json'
Expand Down Expand Up @@ -32,6 +33,12 @@ describe('DetailView (from upload) (40)', () => {

it('Check if folder is there and if files are in folder (40)', () => {
if (!config.isEnabled) return

cy.fileRequest(fileName1, "/starsky-end2end-test", "image/jpeg");
cy.fileRequest(fileName2, "/starsky-end2end-test", "image/jpeg");
cy.fileRequest(fileName3, "/starsky-end2end-test", "image/jpeg");
waitOnUploadIsDone(config.urlApiCollectionsFalse, 0);

cy.visit(config.url)
cy.get(flow.content)
cy.get('.folder > div').should(($lis) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,6 @@
"checkIfDirExistApi": "/starsky/api/search?json=true&t=-isDirectory:true -filepath=/starsky-end2end-test&p=0",
"apiEnvEndpoint": "/api/env"
},
"heroku-demo" : {
"isEnabled": true,
"url": "/?f=/starsky-end2end-test",
"urlHome": "/?f=/",
"urlVideoItemCollectionsFalse": "/?f=/starsky-end2end-test/20200822_134151.mp4&details=true&collections=false",
"urlApiCollectionsFalse": "/api/index/?f=/starsky-end2end-test&collections=false",
"trash": "/trash",
"urlApi": "/api/index/?f=/starsky-end2end-test",
"mkdirApi": "/api/disk/mkdir",
"mkdirName": "starsky-end2end-test",
"mkdirPath": "/starsky-end2end-test",
"searchClearCache": "/api/search/remove-cache?t=-isDirectory:true -filepath=/starsky-end2end-test",
"checkIfDirExistApi": "/starsky/api/search?json=true&t=-isDirectory:true -filepath=/starsky-end2end-test&p=0",
"apiEnvEndpoint": "/api/env"
},
"no-create-account" : {
"isEnabled": true,
"url": "/?f=/starsky-end2end-test",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { checkIfExistAndCreate } from "../helpers/create-directory-helper.cy";
import { checkIfExistAndCreate, waitOnUploadIsDone } from "../helpers/create-directory-helper.cy";
import { envName, envFolder } from "../../support/commands";
import configFile from "./config.json";
const config = configFile[envFolder][envName];
Expand Down Expand Up @@ -58,7 +58,7 @@ describe("Delete file from upload (50)", () => {
cy.fileRequest(fileName1, "/starsky-end2end-test", "image/jpeg");
cy.fileRequest(fileName2, "/starsky-end2end-test", "image/jpeg");
cy.fileRequest(fileName3, "/starsky-end2end-test", "image/jpeg");
waitOnUploadIsDone(0);
waitOnUploadIsDone(config.urlApiCollectionsFalse, 1);
});

it("check if upload is done (50)", () => {
Expand All @@ -68,28 +68,6 @@ describe("Delete file from upload (50)", () => {
});
});

function waitOnUploadIsDone(index: number, max: number = 10) {
cy.request({
url: config.urlApiCollectionsFalse,
method: "GET",
headers: {
"Content-Type": "text/plain",
},
}).then((response) => {
expect(response.status).to.eq(200);
cy.log(JSON.stringify(response.body.fileIndexItems));

if (response.body.fileIndexItems.length === 4) {
cy.log("4 items, done");
return;
}
cy.wait(1500);
index++;
if (index < max) {
waitOnUploadIsDone(index, max);
}
});
}

it("remove collection item, but not the other file (50)", () => {
cy.visit(config.urlVideoItemCollectionsFalse);
Expand Down Expand Up @@ -319,6 +297,5 @@ describe("Delete file from upload (50)", () => {
useSystemTrash: useSystemTrashBeforeStatus,
}
})

});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,37 @@ import { RequestOptions } from 'http'
const config = configFile[envFolder][envName]

describe('Delete folder from upload (50)', () => {

let useSystemTrashBeforeStatus = null;
beforeEach("Check some config settings and do them before each test (50)", () => {
// Check if test is enabled for current environment
if (!config.isEnabled) {
return false;
}

// Reset storage before every new test
cy.resetStorage();

cy.sendAuthenticationHeader();

// disable system trash
cy.request({
url: config.apiEnvEndpoint,
method: "GET",
}).then((response) => {
useSystemTrashBeforeStatus = response.body.useSystemTrash
cy.request({
url: config.apiEnvEndpoint,
method: "POST",
form: true, // indicates the body should be form urlencoded and sets Content-Type
body: {
useSystemTrash: false,
}
})
});

});

beforeEach('Check some config settings and do them before each test (50)', () => {
// Check if test is enabled for current environment
if (!config.isEnabled) {
Expand Down Expand Up @@ -81,4 +112,18 @@ describe('Delete folder from upload (50)', () => {
expect(response.body.fileIndexItems).to.have.length(0)
})
})

it("z cleanup trash settings (50)", () => {
cy.log("cleanup trash settings");
cy.log(useSystemTrashBeforeStatus);

cy.request({
url: config.apiEnvEndpoint,
method: "POST",
form: true, // indicates the body should be form urlencoded and sets Content-Type
body: {
useSystemTrash: useSystemTrashBeforeStatus,
}
})
});
})
Loading
Loading