From d9f44811fd5c46640db3571ef0df2ec4d2565e2b Mon Sep 17 00:00:00 2001 From: draker94 Date: Fri, 24 Feb 2023 18:25:19 +0300 Subject: [PATCH] [engine] Resolve identical Jbehave story names --- .../org/vividus/BatchedPerformableTree.java | 16 ++- .../vividus/IdenticalStoryNamesResolver.java | 107 +++++++++++++++ .../vividus/ResolveToUniqueSimpleName.java | 60 +++++++++ .../resources/org/vividus/engine/spring.xml | 8 +- .../vividus/BatchedPerformableTreeTests.java | 47 ++++++- .../IdenticalStoryNamesResolverTests.java | 122 ++++++++++++++++++ .../ResolveToUniqueSimpleNameTests.java | 112 ++++++++++++++++ .../suite/integration/suite.properties | 4 + .../storiesIdenticalNames/Simple.story | 7 + .../anotherDirectory/Simple.story | 7 + 10 files changed, 484 insertions(+), 6 deletions(-) create mode 100644 vividus-engine/src/main/java/org/vividus/IdenticalStoryNamesResolver.java create mode 100644 vividus-engine/src/main/java/org/vividus/ResolveToUniqueSimpleName.java create mode 100644 vividus-engine/src/test/java/org/vividus/IdenticalStoryNamesResolverTests.java create mode 100644 vividus-engine/src/test/java/org/vividus/ResolveToUniqueSimpleNameTests.java create mode 100644 vividus-tests/src/main/resources/story/integration/storiesIdenticalNames/Simple.story create mode 100644 vividus-tests/src/main/resources/story/integration/storiesIdenticalNames/anotherDirectory/Simple.story diff --git a/vividus-engine/src/main/java/org/vividus/BatchedPerformableTree.java b/vividus-engine/src/main/java/org/vividus/BatchedPerformableTree.java index 48e8a41405..d8ba7dee6a 100644 --- a/vividus-engine/src/main/java/org/vividus/BatchedPerformableTree.java +++ b/vividus-engine/src/main/java/org/vividus/BatchedPerformableTree.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2021 the original author or authors. + * Copyright 2019-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,17 @@ package org.vividus; +import java.util.List; +import java.util.stream.Collectors; + import org.jbehave.core.embedder.PerformableTree; +import org.jbehave.core.model.Story; import org.jbehave.core.steps.StepCollector.Stage; public class BatchedPerformableTree extends PerformableTree { + private static final IdenticalStoryNamesResolver IDENTICAL_STORY_NAMES_RESOLVER = new IdenticalStoryNamesResolver(); + private boolean failFast; private boolean reportBeforeStories; private boolean reportAfterStories; @@ -28,6 +34,14 @@ public class BatchedPerformableTree extends PerformableTree @Override public void performBeforeOrAfterStories(RunContext context, Stage stage) { + if (Stage.BEFORE.equals(stage)) + { + List currentBatchStories = getRoot().getStories().stream() + .filter(p -> p.getStatus() == null) + .map(PerformableStory::getStory) + .collect(Collectors.toList()); + IDENTICAL_STORY_NAMES_RESOLVER.resolveIdenticalNames(currentBatchStories); + } if (reportBeforeStories && Stage.BEFORE.equals(stage) || Stage.AFTER.equals(stage) && (reportAfterStories || failFast && !context.getFailures().isEmpty())) { diff --git a/vividus-engine/src/main/java/org/vividus/IdenticalStoryNamesResolver.java b/vividus-engine/src/main/java/org/vividus/IdenticalStoryNamesResolver.java new file mode 100644 index 0000000000..5a2591866d --- /dev/null +++ b/vividus-engine/src/main/java/org/vividus/IdenticalStoryNamesResolver.java @@ -0,0 +1,107 @@ +/* + * Copyright 2019-2023 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.vividus; + +import java.io.File; +import java.net.URI; +import java.nio.file.InvalidPathException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; +import java.util.stream.Collectors; + +import org.apache.commons.io.FilenameUtils; +import org.jbehave.core.model.Story; + +public class IdenticalStoryNamesResolver +{ + private static final char UNIX_PATH_SEPARATOR = '/'; + + public void resolveIdenticalNames(List stories) + { + for (Story story : stories) + { + String storyName = story.getName(); + List sameNameStories = stories.stream() + .filter(s -> storyName.equals(s.getName())) + .collect(Collectors.toList()); + + if (sameNameStories.size() > 1) + { + Path currentPath = getPathSafely(story.getPath()); + List similarPaths = sameNameStories.stream() + .map(s -> getPathSafely(s.getPath())) + .collect(Collectors.toList()); + + Path commonPath = findCommonPath(currentPath, similarPaths); + updateStoryNames(commonPath, sameNameStories); + } + } + } + + private Path findCommonPath(Path referencePath, List paths) + { + Path root = referencePath.getRoot(); + Path commonPath = root != null ? root : Paths.get(""); + + for (Path directory : referencePath) + { + Path possibleCommonPath = commonPath.resolve(directory); + if (paths.stream().anyMatch(path -> !path.startsWith(possibleCommonPath))) + { + break; + } + commonPath = possibleCommonPath; + } + return commonPath; + } + + private void updateStoryNames(Path commonPath, List stories) + { + for (Story story : stories) + { + String prefix = getPrefix(commonPath, getPathSafely(story.getPath())); + if (prefix != null) + { + if (File.separatorChar == '\\') + { + prefix = prefix.replace(File.separatorChar, UNIX_PATH_SEPARATOR); + } + story.namedAs(prefix + UNIX_PATH_SEPARATOR + story.getName()); + } + } + } + + private String getPrefix(Path commonPath, Path storyPath) + { + Path prefix = commonPath.relativize(storyPath).getParent(); + return prefix != null ? prefix.toString() : null; + } + + private Path getPathSafely(String path) + { + try + { + return Paths.get(path); + } + catch (InvalidPathException e) + { + Path resultPath = Paths.get(URI.create(FilenameUtils.getFullPath(path))); + return Paths.get(resultPath.toString(), FilenameUtils.getName(path)); + } + } +} diff --git a/vividus-engine/src/main/java/org/vividus/ResolveToUniqueSimpleName.java b/vividus-engine/src/main/java/org/vividus/ResolveToUniqueSimpleName.java new file mode 100644 index 0000000000..9775032a91 --- /dev/null +++ b/vividus-engine/src/main/java/org/vividus/ResolveToUniqueSimpleName.java @@ -0,0 +1,60 @@ +/* + * Copyright 2019-2023 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.vividus; + +import java.io.File; + +import org.apache.commons.lang3.StringUtils; +import org.jbehave.core.embedder.PerformableTree; +import org.jbehave.core.embedder.PerformableTree.PerformableStory; +import org.jbehave.core.io.StoryLocation; +import org.jbehave.core.reporters.FilePrintStreamFactory.ResolveToSimpleName; +import org.vividus.context.RunContext; + +public class ResolveToUniqueSimpleName extends ResolveToSimpleName +{ + private static final char UNIX_PATH_SEPARATOR = '/'; + + private final RunContext runContext; + private final PerformableTree performableTree; + + public ResolveToUniqueSimpleName(RunContext runContext, PerformableTree performableTree) + { + this.runContext = runContext; + this.performableTree = performableTree; + } + + @Override + public String resolveName(StoryLocation storyLocation, String extension) + { + String storyPath = storyLocation.getStoryPath(); + + if ("BeforeStories".equals(storyPath) || "AfterStories".equals(storyPath)) + { + return super.resolveName(storyLocation, extension); + } + + String storyName = performableTree.getRoot().getStories().stream() + .map(PerformableStory::getStory) + .filter(s -> s.getPath().equals(storyPath)) + .findFirst().get().getName(); + String storyNameOutput = StringUtils.removeEnd(storyName, "story") + .replace(UNIX_PATH_SEPARATOR, '.') + extension; + + return runContext.getRunningBatchKey() + File.separator + storyNameOutput; + } +} diff --git a/vividus-engine/src/main/resources/org/vividus/engine/spring.xml b/vividus-engine/src/main/resources/org/vividus/engine/spring.xml index 0fbd0b5026..930d09607f 100644 --- a/vividus-engine/src/main/resources/org/vividus/engine/spring.xml +++ b/vividus-engine/src/main/resources/org/vividus/engine/spring.xml @@ -40,13 +40,15 @@ + + - + @@ -83,9 +85,7 @@ - - - + diff --git a/vividus-engine/src/test/java/org/vividus/BatchedPerformableTreeTests.java b/vividus-engine/src/test/java/org/vividus/BatchedPerformableTreeTests.java index ccf3f559ac..a2fa7588f0 100644 --- a/vividus-engine/src/test/java/org/vividus/BatchedPerformableTreeTests.java +++ b/vividus-engine/src/test/java/org/vividus/BatchedPerformableTreeTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2021 the original author or authors. + * Copyright 2019-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,13 +16,19 @@ package org.vividus; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoInteractions; +import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; +import org.jbehave.core.embedder.PerformableTree.PerformableRoot; +import org.jbehave.core.embedder.PerformableTree.PerformableStory; import org.jbehave.core.embedder.PerformableTree.RunContext; +import org.jbehave.core.embedder.PerformableTree.Status; import org.jbehave.core.failures.BatchFailures; +import org.jbehave.core.model.Story; import org.jbehave.core.reporters.StoryReporter; import org.jbehave.core.steps.StepCollector.Stage; import org.junit.jupiter.api.Test; @@ -89,6 +95,40 @@ void testPerformBeforeOrAfterStoriesPerformNoneForAfter() testPerformBeforeOrAfterStoriesPerformNone(Stage.AFTER); } + @Test + void shouldResolveIdenticalNamesBeforeStories() + { + PerformableRoot root = batchedPerformableTree.getRoot(); + Story storyFromPreviousBatch = mock(); + PerformableStory processedStoryFromPreviousBatch = mock(); + when(processedStoryFromPreviousBatch.getStatus()).thenReturn(Status.SUCCESSFUL); + when(processedStoryFromPreviousBatch.getStory()).thenReturn(storyFromPreviousBatch); + Story storyName = new Story("file:/tests/name.story"); + Story storyFolderName = new Story("file:/tests/folder/name.story"); + root.add(processedStoryFromPreviousBatch); + verify(storyFromPreviousBatch).getPath(); + root.add(createPerformableStory(storyName)); + root.add(createPerformableStory(storyFolderName)); + batchedPerformableTree.performBeforeOrAfterStories(runContext, Stage.BEFORE); + verifyNoMoreInteractions(storyFromPreviousBatch); + assertEquals("folder/name.story", storyFolderName.getName()); + } + + @Test + void shouldNotInteractWithStoriesAfterStories() + { + PerformableRoot root = batchedPerformableTree.getRoot(); + Story storyMock = mock(); + PerformableStory performableStoryMock = mock(); + when(performableStoryMock.getStory()).thenReturn(storyMock); + when(storyMock.getPath()).thenReturn(""); + root.add(performableStoryMock); + verify(storyMock).getPath(); + + batchedPerformableTree.performBeforeOrAfterStories(runContext, Stage.AFTER); + verifyNoMoreInteractions(storyMock); + } + private BatchFailures getFailures() { BatchFailures failures = new BatchFailures(); @@ -106,4 +146,9 @@ private void mockRunContext() { when(runContext.reporter()).thenReturn(mock(StoryReporter.class)); } + + private PerformableStory createPerformableStory(Story story) + { + return new PerformableStory(story, null, false); + } } diff --git a/vividus-engine/src/test/java/org/vividus/IdenticalStoryNamesResolverTests.java b/vividus-engine/src/test/java/org/vividus/IdenticalStoryNamesResolverTests.java new file mode 100644 index 0000000000..f0f7322a12 --- /dev/null +++ b/vividus-engine/src/test/java/org/vividus/IdenticalStoryNamesResolverTests.java @@ -0,0 +1,122 @@ +/* + * Copyright 2019-2023 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.vividus; + +import static org.junit.jupiter.api.Assertions.assertAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.mockStatic; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; +import static org.mockito.Mockito.when; + +import java.net.URI; +import java.nio.file.InvalidPathException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; + +import org.jbehave.core.model.Story; +import org.junit.jupiter.api.Test; +import org.mockito.MockedStatic; + +class IdenticalStoryNamesResolverTests +{ + private static final String SEPARATOR = "/"; + private static final String DIRECTORY = "directory"; + private static final String NAME = "name.story"; + private static final String ANOTHER_NAME = "nomen.story"; + + private static final IdenticalStoryNamesResolver NAMES_RESOLVER = new IdenticalStoryNamesResolver(); + + @Test + void shouldResolveIdenticalNames() + { + Story storyName = new Story("file:/tests/name.story"); + Story storyDirectoryName = new Story("file:/tests/directory/name.story"); + Story storyDirectoryAnotherName = new Story("file:/tests/directory/nomen.story"); + Story storyDirectoryDirectoryName = new Story("file:/tests/directory/directory/name.story"); + Story storyDirectory1Name = new Story("file:/tests/directory1/name.story"); + List batchStories = List.of(storyName, storyDirectoryName, storyDirectoryAnotherName, + storyDirectoryDirectoryName, storyDirectory1Name); + + NAMES_RESOLVER.resolveIdenticalNames(batchStories); + assertAll( + () -> assertEquals(NAME, storyName.getName()), + () -> assertEquals(DIRECTORY + SEPARATOR + NAME, storyDirectoryName.getName()), + () -> assertEquals(ANOTHER_NAME, storyDirectoryAnotherName.getName()), + () -> assertEquals(DIRECTORY + SEPARATOR + DIRECTORY + SEPARATOR + NAME, + storyDirectoryDirectoryName.getName()), + () -> assertEquals("directory1" + SEPARATOR + NAME, storyDirectory1Name.getName()) + ); + } + + @Test + void shouldResolveIdenticalNamesWindows() + { + String namePath = "file:/C:/tests/name.story"; + String directoryNamePath = "file:/C:/tests/directory/name.story"; + + Story storyName = new Story(namePath); + Story storyDirectoryName = new Story(directoryNamePath); + List batchStories = List.of(storyName, storyDirectoryName); + + URI nameStoryFullPathUri = URI.create("file:/C:/tests/"); + Path nameStoryResultPath = Paths.get(nameStoryFullPathUri); + Path nameStoryResultPathFull = Paths.get(nameStoryResultPath.toString(), NAME); + + URI directoryNameStoryFullPathUri = URI.create("file:/C:/tests/directory/"); + Path directoryNameStoryResultPath = Paths.get(directoryNameStoryFullPathUri); + Path directoryNameStoryResultPathFull = Paths.get(directoryNameStoryResultPath.toString(), NAME); + + try (MockedStatic paths = mockStatic(Paths.class)) + { + paths.when(() -> Paths.get(namePath)).thenThrow(InvalidPathException.class); + paths.when(() -> Paths.get(nameStoryFullPathUri)).thenReturn(nameStoryResultPath); + paths.when(() -> Paths.get(nameStoryResultPath.toString(), NAME)).thenReturn(nameStoryResultPathFull); + + paths.when(() -> Paths.get(directoryNamePath)).thenThrow(InvalidPathException.class); + paths.when(() -> Paths.get(directoryNameStoryFullPathUri)).thenReturn(directoryNameStoryResultPath); + paths.when(() -> Paths.get(directoryNameStoryResultPath.toString(), NAME)) + .thenReturn(directoryNameStoryResultPathFull); + + NAMES_RESOLVER.resolveIdenticalNames(batchStories); + } + assertAll( + () -> assertEquals(NAME, storyName.getName()), + () -> assertEquals(DIRECTORY + SEPARATOR + NAME, storyDirectoryName.getName()) + ); + } + + @Test + void shouldNotProcessDifferentNames() + { + Story storyMock1 = mock(); + Story storyMock2 = mock(); + when(storyMock1.getPath()).thenReturn("file:/tests/name1.story"); + when(storyMock2.getPath()).thenReturn("file:/tests/name2.story"); + when(storyMock1.getName()).thenReturn("name1"); + when(storyMock2.getName()).thenReturn("name2"); + List batchStories = List.of(storyMock1, storyMock2); + + NAMES_RESOLVER.resolveIdenticalNames(batchStories); + verify(storyMock1, times(3)).getName(); + verify(storyMock2, times(3)).getName(); + verifyNoMoreInteractions(storyMock1, storyMock2); + } +} diff --git a/vividus-engine/src/test/java/org/vividus/ResolveToUniqueSimpleNameTests.java b/vividus-engine/src/test/java/org/vividus/ResolveToUniqueSimpleNameTests.java new file mode 100644 index 0000000000..616e1a96a3 --- /dev/null +++ b/vividus-engine/src/test/java/org/vividus/ResolveToUniqueSimpleNameTests.java @@ -0,0 +1,112 @@ +/* + * Copyright 2019-2023 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.vividus; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.params.provider.Arguments.arguments; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verifyNoInteractions; + +import java.io.File; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.stream.Stream; + +import org.jbehave.core.embedder.PerformableTree; +import org.jbehave.core.embedder.PerformableTree.PerformableRoot; +import org.jbehave.core.embedder.PerformableTree.PerformableStory; +import org.jbehave.core.io.StoryLocation; +import org.jbehave.core.model.Story; +import org.jbehave.core.steps.StepCollector.Stage; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.params.provider.ValueSource; +import org.mockito.junit.jupiter.MockitoExtension; +import org.vividus.context.RunTestContext; + +@ExtendWith(MockitoExtension.class) +class ResolveToUniqueSimpleNameTests +{ + private static final String EXTENSION = "xml"; + private static final String SEPARATOR = File.separator; + private static final String BATCH_DIR = "batch-1"; + private static final String STORY_NAME = "file:/tests/name.story"; + private static final String STORY_DIRECTORY_NAME = "file:/tests/directory/name.story"; + private static final String STORY_DIRECTORY_ANOTHER_NAME = "file:/tests/directory/nomen.story"; + private static final String STORY_DIRECTORY_DIRECTORY_NAME = "file:/tests/directory/directory/name.story"; + private static final String STORY_DIRECTORY1_NAME = "file:/tests/directory1/name.story"; + + private static final BatchedPerformableTree PERFORMABLE_TREE = new BatchedPerformableTree(); + private static final ResolveToUniqueSimpleName RESOLVE_TO_UNIQUE_SIMPLE_NAME = new ResolveToUniqueSimpleName( + new RunTestContext(), PERFORMABLE_TREE); + + private URL codeLocation; + + @BeforeEach + void beforeEach() throws MalformedURLException + { + codeLocation = new URL("file:/location/"); + PerformableRoot root = PERFORMABLE_TREE.getRoot(); + root.add(createPerformableStory(new Story(STORY_NAME))); + root.add(createPerformableStory(new Story(STORY_DIRECTORY_NAME))); + root.add(createPerformableStory(new Story(STORY_DIRECTORY_ANOTHER_NAME))); + root.add(createPerformableStory(new Story(STORY_DIRECTORY_DIRECTORY_NAME))); + root.add(createPerformableStory(new Story(STORY_DIRECTORY1_NAME))); + } + + static Stream storiesDataProvider() + { + return Stream.of( + arguments(STORY_NAME, "name"), + arguments(STORY_DIRECTORY_NAME, "directory.name"), + arguments(STORY_DIRECTORY_ANOTHER_NAME, "nomen"), + arguments(STORY_DIRECTORY_DIRECTORY_NAME, "directory.directory.name"), + arguments(STORY_DIRECTORY1_NAME, "directory1.name") + ); + } + + @ParameterizedTest + @MethodSource("storiesDataProvider") + void shouldResolveName(String storyPath, String expectedName) + { + PERFORMABLE_TREE.performBeforeOrAfterStories(null, Stage.BEFORE); + StoryLocation storyLocation = new StoryLocation(codeLocation, storyPath); + assertEquals(String.format("%s%s%s.%s", BATCH_DIR, SEPARATOR, expectedName, EXTENSION), + RESOLVE_TO_UNIQUE_SIMPLE_NAME.resolveName(storyLocation, EXTENSION)); + } + + @ParameterizedTest + @ValueSource(strings = { "BeforeStories", "AfterStories" }) + void shouldIgnoreBeforeAndAfterStories(String ignoredPath) + { + PerformableTree performableTreeMocked = mock(); + ResolveToUniqueSimpleName resolveToUniqueSimpleName = new ResolveToUniqueSimpleName(new RunTestContext(), + performableTreeMocked); + StoryLocation storyLocation = new StoryLocation(codeLocation, ignoredPath); + + resolveToUniqueSimpleName.resolveName(storyLocation, EXTENSION); + verifyNoInteractions(performableTreeMocked); + } + + private PerformableStory createPerformableStory(Story story) + { + return new PerformableStory(story, null, false); + } +} diff --git a/vividus-tests/src/main/resources/properties/suite/integration/suite.properties b/vividus-tests/src/main/resources/properties/suite/integration/suite.properties index 8f7efdde0f..d362415de4 100644 --- a/vividus-tests/src/main/resources/properties/suite/integration/suite.properties +++ b/vividus-tests/src/main/resources/properties/suite/integration/suite.properties @@ -35,6 +35,10 @@ batch-5.resource-location=story/integration/knownissue batch-5.resource-include-patterns=Validate known issues.story batch-5.name=5. Validate results of known issues tests +batch-6.resource-location=story/integration/storiesIdenticalNames +batch-6.resource-include-patterns=**/*.story +batch-6.name=6. Resolve stories with identical names + ui.visual.ignored-elements=By.id(some_fake_id) # Check that property value can be non-string and it can be successfully assigned diff --git a/vividus-tests/src/main/resources/story/integration/storiesIdenticalNames/Simple.story b/vividus-tests/src/main/resources/story/integration/storiesIdenticalNames/Simple.story new file mode 100644 index 0000000000..b6d7ed6f99 --- /dev/null +++ b/vividus-tests/src/main/resources/story/integration/storiesIdenticalNames/Simple.story @@ -0,0 +1,7 @@ +Meta: + @epic vividus-engine + +Scenario: Simple validation +Meta: + @requirementId 3607 +Then `1` is equal to `1` diff --git a/vividus-tests/src/main/resources/story/integration/storiesIdenticalNames/anotherDirectory/Simple.story b/vividus-tests/src/main/resources/story/integration/storiesIdenticalNames/anotherDirectory/Simple.story new file mode 100644 index 0000000000..b6d7ed6f99 --- /dev/null +++ b/vividus-tests/src/main/resources/story/integration/storiesIdenticalNames/anotherDirectory/Simple.story @@ -0,0 +1,7 @@ +Meta: + @epic vividus-engine + +Scenario: Simple validation +Meta: + @requirementId 3607 +Then `1` is equal to `1`