Permalink
Show file tree
Hide file tree
6 changes: 6 additions & 0 deletions
6
...m-appwithinminutes-test-docker/src/test/it/org/xwiki/appwithinminutes/test/ui/AllITs.java
4 changes: 4 additions & 0 deletions
4
...inminutes-test-docker/src/test/it/org/xwiki/appwithinminutes/test/ui/AppsLiveTableIT.java
6 changes: 2 additions & 4 deletions
6
...appwithinminutes-test-docker/src/test/it/org/xwiki/appwithinminutes/test/ui/WizardIT.java
6 changes: 6 additions & 0 deletions
6
...-platform-core/xwiki-platform-appwithinminutes/xwiki-platform-appwithinminutes-ui/pom.xml
5 changes: 5 additions & 0 deletions
5
...ki-platform-appwithinminutes-ui/src/main/resources/AppWithinMinutes/CreateApplication.xml
8 changes: 7 additions & 1 deletion
8
...i-platform-appwithinminutes-ui/src/main/resources/AppWithinMinutes/LiveTableEditSheet.xml
1 change: 1 addition & 0 deletions
1
...s/xwiki-platform-appwithinminutes-ui/src/main/resources/AppWithinMinutes/Translations.xml
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
XWIKI-20190: Properly handle AWM creation without script right
* Warn when the user doesn't have script right. * Ensure that in integration tests the users have script right. * Add an explicit test for the behavior without script right. * Fix missing dependency. * Actually delete the preferences in AppsLiveTableIT.
- Loading branch information
Showing
8 changed files
with
127 additions
and
5 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
96 changes: 96 additions & 0 deletions
96
...utes-test-docker/src/test/it/org/xwiki/appwithinminutes/test/ui/WithoutScriptRightIT.java
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,96 @@ | ||
| /* | ||
| * See the NOTICE file distributed with this work for additional | ||
| * information regarding copyright ownership. | ||
| * | ||
| * This is free software; you can redistribute it and/or modify it | ||
| * under the terms of the GNU Lesser General Public License as | ||
| * published by the Free Software Foundation; either version 2.1 of | ||
| * the License, or (at your option) any later version. | ||
| * | ||
| * This software 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 | ||
| * Lesser General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Lesser General Public | ||
| * License along with this software; if not, write to the Free | ||
| * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
| */ | ||
| package org.xwiki.appwithinminutes.test.ui; | ||
|
|
||
| import org.junit.jupiter.api.BeforeAll; | ||
| import org.junit.jupiter.api.Order; | ||
| import org.junit.jupiter.api.Test; | ||
| import org.xwiki.appwithinminutes.test.po.AppWithinMinutesHomePage; | ||
| import org.xwiki.appwithinminutes.test.po.ApplicationClassEditPage; | ||
| import org.xwiki.appwithinminutes.test.po.ApplicationCreatePage; | ||
| import org.xwiki.appwithinminutes.test.po.ApplicationHomeEditPage; | ||
| import org.xwiki.appwithinminutes.test.po.ApplicationHomePage; | ||
| import org.xwiki.appwithinminutes.test.po.ApplicationsLiveTableElement; | ||
| import org.xwiki.appwithinminutes.test.po.EntryEditPage; | ||
| import org.xwiki.appwithinminutes.test.po.EntryNamePane; | ||
| import org.xwiki.test.docker.junit5.TestReference; | ||
| import org.xwiki.test.docker.junit5.UITest; | ||
| import org.xwiki.test.ui.TestUtils; | ||
|
|
||
| import static org.junit.jupiter.api.Assertions.assertFalse; | ||
| import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
|
||
| /** | ||
| * Tests AWM without script right. | ||
| * | ||
| * @version $Id$ | ||
| * @since 13.10.11 | ||
| * @since 14.4.8 | ||
| * @since 14.10.1 | ||
| * @since 15.0RC1 | ||
| */ | ||
| @UITest | ||
| class WithoutScriptRightIT | ||
| { | ||
| private static final String USER_NAME = "NoScript"; | ||
|
|
||
| private static final String PASSWORD = "password"; | ||
|
|
||
| private static final String NO_SCRIPT_ERROR = "You don't have the script right which is necessary to create or " | ||
| + "edit an application. The application might not work correctly when you continue."; | ||
|
|
||
| @BeforeAll | ||
| static void beforeAll(TestUtils testUtils) | ||
| { | ||
| testUtils.loginAsSuperAdmin(); | ||
| testUtils.createUserAndLogin(USER_NAME, PASSWORD, ""); | ||
| } | ||
|
|
||
| @Order(1) | ||
| @Test | ||
| void createApplicationWithoutScriptRight(TestReference testReference) | ||
| { | ||
| ApplicationCreatePage appCreatePage = AppWithinMinutesHomePage.gotoPage().clickCreateApplication(); | ||
| String appName = testReference.getLastSpaceReference().getName(); | ||
| appCreatePage.setApplicationName(appName); | ||
| appCreatePage.waitForApplicationNamePreview(); | ||
| assertTrue(appCreatePage.getContent().contains(NO_SCRIPT_ERROR)); | ||
|
|
||
| ApplicationClassEditPage classEditPage = appCreatePage.clickNextStep(); | ||
| classEditPage.addField("Short Text"); | ||
| ApplicationHomeEditPage applicationHomeEditPage = classEditPage.clickNextStep().clickNextStep(); | ||
| assertTrue(applicationHomeEditPage.getContent().contains(NO_SCRIPT_ERROR)); | ||
|
|
||
| ApplicationHomePage applicationHomePage = applicationHomeEditPage.clickFinish(); | ||
| // TODO: change to assert rendering errors when https://jira.xwiki.org/browse/XWIKI-20423 has been fixed. | ||
| assertTrue(applicationHomePage.hasEntriesLiveTable()); | ||
|
|
||
| EntryNamePane entryNamePane = applicationHomePage.clickAddNewEntry(); | ||
| entryNamePane.setName("Test entry"); | ||
| EntryEditPage editPage = entryNamePane.clickAdd(); | ||
| // The edit form doesn't work without script right. | ||
| assertTrue(editPage.hasRenderingError()); | ||
|
|
||
| // Without script right, no delete is available. | ||
| ApplicationsLiveTableElement liveTable = AppWithinMinutesHomePage.gotoPage().getAppsLiveTable(); | ||
| assertTrue(liveTable.isApplicationListed(appName)); | ||
| assertFalse(liveTable.canDeleteApplication(appName)); | ||
| } | ||
| } |
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
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