-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Louis Chemineau <louis@chmn.me>
- Loading branch information
Showing
76 changed files
with
18,436 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* @copyright Copyright (c) 2022 Louis Chmn <louis@chmn.me> | ||
* | ||
* @author Louis Chmn <louis@chmn.me> | ||
* | ||
* @license AGPL-3.0-or-later | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
import { uploadTestMedia } from './photosUtils' | ||
import { navigateToLocation, runOccCommand } from './locationsUtils' | ||
|
||
const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/ | ||
Cypress.on('uncaught:exception', (err) => { | ||
/* returning false here prevents Cypress from failing the test */ | ||
if (resizeObserverLoopErrRe.test(err.message)) { | ||
return false | ||
} | ||
}) | ||
|
||
describe('Manage locations', () => { | ||
before(function() { | ||
cy.createRandomUser() | ||
.then((user) => { | ||
uploadTestMedia(user) | ||
runOccCommand(`photos:map-media-to-location --user ${user.userId}`) | ||
cy.login(user) | ||
cy.visit('/apps/photos') | ||
}) | ||
}) | ||
|
||
beforeEach(() => { | ||
cy.visit('apps/photos/locations') | ||
}) | ||
|
||
it('Check that we detect some locations out of the existing files', () => { | ||
cy.get('ul.collections__list li').should('have.length', 4) | ||
}) | ||
|
||
it('Navigate to location and check that it contains some files', () => { | ||
navigateToLocation('Lauris') | ||
cy.get('[data-test="media"]').should('have.length', 1) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* @copyright Copyright (c) 2023 Louis Chmn <louis@chmn.me> | ||
* | ||
* @author Louis Chmn <louis@chmn.me> | ||
* | ||
* @license AGPL-3.0-or-later | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
export function navigateToCollection(collectionType: string, collectionName: string) { | ||
cy.get('.app-navigation__list').contains(collectionType).click() | ||
cy.get('ul.collections__list').contains(collectionName).click() | ||
} | ||
|
||
export function navigateToLocation(locationName: string) { | ||
navigateToCollection('Places', locationName) | ||
} | ||
|
||
export function runOccCommand(command: string) { | ||
cy.exec(`docker exec --user www-data nextcloud-cypress-tests-photos php ./occ ${command}`) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...extcloud_sharing_dist_index_js-node_modules_vue-material-design-icons_AccountGr-e8a447.js
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...loud_sharing_dist_index_js-node_modules_vue-material-design-icons_AccountGr-e8a447.js.map
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.