|
17 | 17 | */
|
18 | 18 | package ru.mystamps.web.tests.cases;
|
19 | 19 |
|
20 |
| -import java.io.File; |
21 |
| -import java.net.URISyntaxException; |
22 |
| - |
23 | 20 | import org.springframework.beans.factory.annotation.Value;
|
24 | 21 |
|
25 | 22 | import org.testng.annotations.AfterClass;
|
26 | 23 | import org.testng.annotations.BeforeClass;
|
27 | 24 | import org.testng.annotations.BeforeMethod;
|
28 | 25 | import org.testng.annotations.Test;
|
29 | 26 |
|
30 |
| -import ru.mystamps.web.tests.page.AbstractPage; |
31 | 27 | import ru.mystamps.web.tests.page.AddSeriesPage;
|
32 |
| -import ru.mystamps.web.tests.page.InfoSeriesPage; |
33 | 28 |
|
34 | 29 | import static ru.mystamps.web.tests.fest.PageWithFormAssert.assertThat;
|
35 | 30 |
|
36 |
| -import static org.fest.assertions.api.Assertions.assertThat; |
37 |
| - |
38 | 31 | /**
|
39 | 32 | * The main difference between this test and {@link WhenUserAddSeries} is that as admin we have
|
40 | 33 | * additional field for comment.
|
41 | 34 | */
|
42 | 35 | public class WhenAdminAddSeries extends WhenAnyUserAtAnyPageWithForm<AddSeriesPage> {
|
43 | 36 |
|
44 |
| - private static final String SAMPLE_IMAGE_NAME = "test/test.png"; |
45 |
| - private static final String SAMPLE_IMAGE_PATH; |
46 |
| - |
47 |
| - static { |
48 |
| - try { |
49 |
| - SAMPLE_IMAGE_PATH = new File( |
50 |
| - WhenAdminAddSeries.class.getClassLoader().getResource(SAMPLE_IMAGE_NAME).toURI() |
51 |
| - ).getAbsolutePath(); |
52 |
| - |
53 |
| - } catch (URISyntaxException e) { |
54 |
| - throw new RuntimeException(e); |
55 |
| - } |
56 |
| - } |
57 |
| - |
58 | 37 | @Value("${valid_admin_login}")
|
59 | 38 | private String validAdminLogin;
|
60 | 39 |
|
61 | 40 | @Value("${valid_admin_password}")
|
62 | 41 | private String validAdminPassword;
|
63 | 42 |
|
64 |
| - @Value("${existing_michel_number}") |
65 |
| - private String existingMichelNumber; |
66 |
| - |
67 |
| - @Value("${existing_scott_number}") |
68 |
| - private String existingScottNumber; |
69 |
| - |
70 |
| - @Value("${existing_yvert_number}") |
71 |
| - private String existingYvertNumber; |
72 |
| - |
73 |
| - @Value("${existing_gibbons_number}") |
74 |
| - private String existingGibbonsNumber; |
75 |
| - |
76 |
| - @Value("${valid_category_name_en}") |
77 |
| - private String validCategoryName; |
78 |
| - |
79 | 43 | public WhenAdminAddSeries() {
|
80 | 44 | super(AddSeriesPage.class);
|
81 | 45 | }
|
@@ -127,25 +91,4 @@ public void commentShouldBeStripedFromLeadingAndTrailingSpaces() {
|
127 | 91 | assertThat(page).field("comment").hasValue("example comment");
|
128 | 92 | }
|
129 | 93 |
|
130 |
| - @Test(groups = "logic", dependsOnGroups = { "std", "misc" }) |
131 |
| - public void shouldAllowExistingCatalogNumbers() { |
132 |
| - page.fillCategory(validCategoryName); |
133 |
| - page.fillQuantity("2"); |
134 |
| - page.fillImage(SAMPLE_IMAGE_PATH); |
135 |
| - page.showCatalogNumbers(); |
136 |
| - page.fillMichelNumbers(existingMichelNumber); |
137 |
| - page.fillScottNumbers(existingScottNumber); |
138 |
| - page.fillYvertNumbers(existingYvertNumber); |
139 |
| - page.fillGibbonsNumbers(existingGibbonsNumber); |
140 |
| - |
141 |
| - AbstractPage next = page.submit(); |
142 |
| - assertThat(next).isInstanceOf(InfoSeriesPage.class); |
143 |
| - |
144 |
| - InfoSeriesPage nextPage = (InfoSeriesPage)next; |
145 |
| - assertThat(nextPage.getMichelCatalogInfo()).isEqualTo("#" + existingMichelNumber); |
146 |
| - assertThat(nextPage.getScottCatalogInfo()).isEqualTo("#" + existingScottNumber); |
147 |
| - assertThat(nextPage.getYvertCatalogInfo()).isEqualTo("#" + existingYvertNumber); |
148 |
| - assertThat(nextPage.getGibbonsCatalogInfo()).isEqualTo("#" + existingGibbonsNumber); |
149 |
| - } |
150 |
| - |
151 | 94 | }
|
0 commit comments