This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #796 from zanata/rhbz1211849-change-slug
Rhbz1211849 change slug
- Loading branch information
Showing
42 changed files
with
1,060 additions
and
312 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
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
87 changes: 87 additions & 0 deletions
87
functional-test/src/test/java/org/zanata/feature/projectversion/EditVersionSlugTest.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,87 @@ | ||
/* | ||
* Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the | ||
* @author tags. See the copyright.txt file in the distribution for a full | ||
* listing of individual contributors. | ||
* | ||
* 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.zanata.feature.projectversion; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import org.junit.Before; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.experimental.categories.Category; | ||
import org.zanata.feature.Feature; | ||
import org.zanata.feature.testharness.TestPlan.DetailedTest; | ||
import org.zanata.feature.testharness.ZanataTestCase; | ||
import org.zanata.page.projectversion.versionsettings.VersionGeneralTab; | ||
import org.zanata.util.SampleProjectRule; | ||
import org.zanata.util.ZanataRestCaller; | ||
import org.zanata.workflow.LoginWorkFlow; | ||
import org.zanata.workflow.ProjectWorkFlow; | ||
|
||
/** | ||
* /** | ||
* @author Patrick Huang | ||
* <a href="mailto:pahuang@redhat.com">pahuang@redhat.com</a> | ||
*/ | ||
@Category(DetailedTest.class) | ||
public class EditVersionSlugTest extends ZanataTestCase { | ||
|
||
@Rule | ||
public SampleProjectRule sampleProjectRule = new SampleProjectRule(); | ||
|
||
private ZanataRestCaller zanataRestCaller; | ||
|
||
@Before | ||
public void before() { | ||
zanataRestCaller = new ZanataRestCaller(); | ||
zanataRestCaller.createProjectAndVersion("change-version-slug", | ||
"oldSlug", "file"); | ||
} | ||
|
||
@Feature(summary = "Project version slug can be changed and page will redirect to new URL", | ||
tcmsTestPlanIds = 0, tcmsTestCaseIds = 0) | ||
@Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION) | ||
public void changeVersionSlug() throws Exception { | ||
assertThat(new LoginWorkFlow() | ||
.signIn("admin", "admin") | ||
.loggedInAs()) | ||
.isEqualTo("admin") | ||
.as("Admin user has logged in"); | ||
|
||
VersionGeneralTab versionGeneralTab = new ProjectWorkFlow() | ||
.goToProjectByName("change-version-slug") | ||
.gotoVersion("oldSlug") | ||
.gotoSettingsTab() | ||
.gotoSettingsGeneral() | ||
.enterVersionID("newSlug") | ||
.updateVersion(); | ||
|
||
versionGeneralTab.reload(); | ||
assertThat(versionGeneralTab.getUrl()).contains("/newSlug"); | ||
|
||
versionGeneralTab = versionGeneralTab | ||
.gotoSettingsTab() | ||
.gotoSettingsGeneral(); | ||
assertThat(versionGeneralTab.getVersionID()) | ||
.isEqualTo("newSlug") | ||
.as("The version slug has been changed"); | ||
} | ||
} |
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
Oops, something went wrong.