From af0d1aa33a17dee3c3663a064ddc8aed572f19c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Balog?= Date: Sat, 24 Jul 2021 08:55:08 +0200 Subject: [PATCH] Release v0.6.0 changes (#58) * #52: Add search capability to the Terra Wdio tool window * Fix a NPE related to toggling statistics. * #53: add support for terra-functional-testing in the currently available feature set * Fix disposal logic of the root and spec node * #53: Update Terra wdio quick documentation provider to retrieve values from a dedicated bundle, and added links to terra-functional-testing documentation * #53: Add inspection to validate various Terra helper properties. Define sections in TerraBundle for better readablity. Move methods from TerraWdioInspectionBase to TerraWdioPsiUtil. * Improve Terra Functional Testing specific screenshot name resolution and add unit test for error handling of collecting screenshots * #44, #53: Add inspection to convert Terra.it helpers to Terra.validates forms. Replace some information in the readme with custom badges. * #53: Create inspections to validate the presence of screenshot names and the absence of duplicate screenshot names. Implement NoopResourceManager for projects not using any of the Terra libraries.Remove some commented out code. --- CHANGELOG.md | 24 +++ CONTRIBUTE.md | 38 +--- README.md | 4 +- ..._terra_it_quick_fix_before_hook_merged.png | Bin 0 -> 1536 bytes ...rra_it_quick_fix_before_hook_unaltered.png | Bin 0 -> 1526 bytes assets/replate_terra_it_quick_fix_simple.png | Bin 0 -> 1094 bytes changelog.html | 8 +- ...{terra_screenshots.md => terra_helpers.md} | 180 +++++++++++----- docs/terra_wdio_tool_window.md | 3 + .../picimako/terra/FileTypePreconditions.java | 16 +- ...escribeViewportsDocumentationProvider.java | 43 ++-- .../documentation/TerraQuickDocBundle.java | 43 ++++ .../TerraWdioDocumentationProvider.java | 53 ++--- .../TerraWdioDocumentationService.java | 47 ---- .../picimako/terra/psi/js/JSArgumentUtil.java | 23 +- .../picimako/terra/resources/TerraBundle.java | 8 +- .../terra/wdio/NoopResourceManager.java | 102 +++++++++ .../terra/wdio/ScreenshotContextParser.java | 44 ++++ .../terra/wdio/SpecFolderCollector.java | 61 ++++++ .../wdio/TerraFunctionalTestingManager.java | 68 ++++++ ...ctionalTestingScreenshotContextParser.java | 57 +++++ .../wdio/TerraResourceHandlerProvider.java | 36 ++++ .../terra/wdio/TerraResourceManager.java | 103 +++++++++ .../terra/wdio/TerraToolkitManager.java | 68 ++++++ ... TerraToolkitScreenshotContextParser.java} | 36 ++-- .../picimako/terra/wdio/TerraWdioFolders.java | 36 ++-- .../terra/wdio/TerraWdioInspectionBase.java | 42 +--- .../picimako/terra/wdio/TerraWdioPsiUtil.java | 129 +++++++++-- .../wdio/ToScreenshotUsageNavigator.java | 9 +- .../AbstractScreenshotsPreview.java | 12 +- .../TerraScreenshotsDiffViewContainer.java | 12 +- ...ceTerraItWithTerraValidatesInspection.java | 171 +++++++++++++++ ...ateToScreenshotUsageProjectViewAction.java | 8 +- .../AbstractScreenshotNameResolver.java | 54 +++++ .../screenshot/ScreenshotNameResolver.java | 72 +++++++ ...nctionalTestingScreenshotNameResolver.java | 97 +++++++++ .../screenshot/TerraScreenshotCollector.java | 8 +- ...> TerraToolkitScreenshotNameResolver.java} | 46 +--- ...creenshotValidationLineMarkerProvider.java | 8 +- .../TerraScreenshotInlayHintsProvider.kt | 7 +- .../DuplicateScreenshotNameInspection.java | 89 ++++++++ .../GlobalTerraSelectorInspection.java | 13 +- ...idTerraValidationPropertiesInspection.java | 88 ++++++++ .../MissingScreenshotInspection.java | 15 +- .../MissingScreenshotNameInspection.java | 72 +++++++ ...otMismatchToleranceBlockingInspection.java | 25 ++- ...ScreenshotMismatchToleranceInspection.java | 20 +- ...onIsPreferredOverScreenshotInspection.java | 22 +- ...raFunctionalTestingPropertiesProvider.java | 50 +++++ .../inspection/TerraPropertiesProvider.java | 45 ++++ .../TerraToolkitPropertiesProvider.java | 51 +++++ .../reference/TerraScreenshotPsiFile.java | 6 +- .../reference/TerraScreenshotReference.java | 11 +- .../TerraScreenshotReferenceContributor.java | 17 +- .../AbstractTerraWdioTreeModel.java | 160 ++++++++++++++ .../FindUnusedScreenshotsAction.java | 32 +-- ...ioExternalFileAndFolderChangeListener.java | 3 +- .../toolwindow/TerraWdioScreenshotsPanel.java | 3 + .../TerraWdioToolWindowFactory.java | 8 +- .../terra/wdio/toolwindow/TerraWdioTree.java | 87 -------- .../toolwindow/TerraWdioTreeCellRenderer.java | 77 ------- .../wdio/toolwindow/TerraWdioTreeModel.java | 200 +++++------------- .../toolwindow/ToggleStatisticsAction.java | 4 +- .../AbstractTerraWdioToolWindowAction.java | 2 +- ...eLatestWithReferenceScreenshotsAction.java | 6 +- .../action/DeleteScreenshotsAction.java | 16 +- .../NavigateToScreenshotUsageAction.java | 17 +- .../action/RenameScreenshotsAction.java | 24 +-- .../ReplaceReferenceWithLatestAction.java | 14 +- .../action/ShowDiffScreenshotsAction.java | 6 +- .../action/TerraWdioDataRetrieverUtil.java | 2 +- .../TerraWdioScreenshotActionsGroup.java | 2 +- ...eListeningScreenshotNodeActionInvoker.java | 2 +- ...yListeningScreenshotNodeActionInvoker.java | 2 +- .../event/ToolWindowPopupMenuInvoker.java | 2 +- .../event/TreeNodeTypeIdentifier.java | 6 +- .../{ => node}/AbstractTerraWdioTreeNode.java | 28 ++- .../wdio/toolwindow/node/TerraWdioTree.java | 140 ++++++++++++ .../{ => node}/TerraWdioTreeNode.java | 34 +-- .../TreeModelDataRoot.java} | 36 ++-- .../TreeScreenshotNode.java} | 20 +- .../TreeSpecNode.java} | 41 ++-- ...icateDescribeViewportsBlockInspection.java | 28 +-- ...beViewportsBlocksNotAllowedInspection.java | 12 +- ...raDescribeViewportsBlockingInspection.java | 15 +- .../TerraDescribeViewportsInspection.java | 13 +- src/main/resources/META-INF/plugin.xml | 22 +- .../documentation/terra-wdio-docs.properties | 12 -- .../DuplicateScreenshotName.html | 28 +++ .../InvalidTerraValidationProperties.html | 57 +++++ .../MissingScreenshotName.html | 27 +++ .../ReplaceTerraItWithTerraValidates.html | 28 +++ .../resources/messages/TerraBundle.properties | 23 +- .../messages/TerraQuickDocBundle.properties | 47 ++++ .../terra/FileTypePreconditionsTest.java | 22 ++ .../terra/TerraFunctionalTestingTestCase.java | 40 ++++ .../picimako/terra/TerraToolkitTestCase.java | 40 ++++ ...ibeViewportsDocumentationProviderTest.java | 99 ++++----- .../TerraWdioDocumentationProviderTest.java | 103 ++------- .../terra/psi/js/JSArgumentUtilTest.java | 26 +++ ...raFunctionalTestingInspectionTestCase.java | 36 ++++ ...ctionalTestingSpecFolderCollectorTest.java | 57 +++++ .../wdio/TerraInspectionBaseTestCase.java | 8 + .../wdio/TerraToolkitInspectionTestCase.java | 36 ++++ .../TerraToolkitSpecFolderCollectorTest.java | 50 +++++ .../terra/wdio/TerraWdioFoldersTest.java | 14 -- ...erraWdioPsiUtilScreenshotPropertyTest.java | 29 +++ .../terra/wdio/TerraWdioPsiUtilTest.java | 95 ++++----- .../wdio/ToScreenshotUsageNavigatorTest.java | 11 +- .../AbstractScreenshotsPreviewTest.java | 5 +- .../DiffScreenshotsPreviewTest.java | 5 +- ...ferenceToLatestScreenshotsPreviewTest.java | 4 +- ...nalTestingScreenshotContextParserTest.java | 41 ++++ ...lidatesInspectionForAccessibilityTest.java | 48 +++++ ...aValidatesInspectionForScreenshotTest.java | 52 +++++ ...rraItWithTerraValidatesInspectionTest.java | 84 ++++++++ ...oScreenshotUsageProjectViewActionTest.java | 5 +- ...onalTestingScreenshotNameResolverTest.java | 85 ++++++++ .../TerraScreenshotCollectorTest.java | 23 +- .../TerraScreenshotNameResolverTest.java | 119 ----------- ...erraToolkitScreenshotNameResolverTest.java | 176 +++++++++++++++ ...nshotValidationLineMarkerProviderTest.java | 5 +- ...tInlayHintsProviderNoGlobalSelectorTest.kt | 3 + .../TerraScreenshotInlayHintsProviderTest.kt | 3 + ...DuplicateScreenshotNameInspectionTest.java | 48 +++++ .../GlobalTerraSelectorInspectionTest.java | 4 +- ...aFTValidationPropertiesInspectionTest.java | 42 ++++ ...kitValidationPropertiesInspectionTest.java | 43 ++++ .../MissingScreenshotInspectionTest.java | 4 +- .../MissingScreenshotNameInspectionTest.java | 42 ++++ ...ToleranceAboveThresholdInspectionTest.java | 4 +- ...PreferredOverScreenshotInspectionTest.java | 4 +- ...matchHasNonNumericValueInspectionTest.java | 4 +- ...atchOutsideOfBoundariesInspectionTest.java | 4 +- ...eenshotCollectorFunctionalTestingTest.java | 78 +++++++ .../TerraScreenshotReferenceTest.java | 5 +- .../FindUnusedScreenshotsActionTest.java | 21 +- ...ternalFileAndFolderChangeListenerTest.java | 1 + ...rraWdioToolWindowFactoryNegativeTest.java} | 18 +- .../TerraWdioToolWindowFactoryTest.java | 77 ++----- .../TerraWdioTreeCellRendererTest.java | 88 -------- .../TerraWdioTreeNodeRendererTest.java | 99 +++++++++ .../toolwindow/TerraWdioTreeNodeTest.java | 13 +- ...otTest.java => TreeModelDataRootTest.java} | 48 +++-- ...eTest.java => TreeScreenshotNodeTest.java} | 18 +- ...pecNodeTest.java => TreeSpecNodeTest.java} | 19 +- .../NavigateToScreenshotUsageActionTest.java | 16 +- ...raToolkitScreenshotContextParserTest.java} | 10 +- ...eDescribeViewportsBlockInspectionTest.java | 4 +- ...eTerraDescribeViewportsInspectionTest.java | 4 +- ...ewportsBlocksNotAllowedInspectionTest.java | 4 +- ...ortsNotInAscendingOrderInspectionTest.java | 4 +- .../NoActualTerraViewportsInspectionTest.java | 4 +- .../NonArrayTypeViewportsInspectionTest.java | 4 +- ...dTerraDescribeViewportsInspectionTest.java | 4 +- testdata/terra/functestroot/package.json | 6 + .../tests/wdio/CollectScreenshots-spec.js} | 6 +- .../tests/wdio/FindUnusedScreenshot-spec.js} | 6 +- .../terra_screenshot.png | Bin 0 -> 119 bytes .../terra_screenshot.png | Bin 0 -> 119 bytes .../terra_screenshot.png | Bin 0 -> 119 bytes .../terra_screenshot.png | Bin 0 -> 119 bytes .../terra_screenshot.png | Bin 0 -> 119 bytes .../DuplicateScreenshotName-spec.js | 34 +++ .../InvalidTerraValidationProperties-spec.js | 47 ++++ ...onPropertiesTerraFunctionalTesting-spec.js | 39 ++++ .../screenshot/MandatoryNameParameter-spec.js | 56 +++++ .../TriplicateScreenshotName-spec.js | 42 ++++ .../inspection/wdio/screenshot/package.json | 6 + .../ItValidatesAccessibility-spec.after.js} | 6 +- .../ItValidatesAccessibility-spec.js} | 8 +- ...esAccessibilityWithArguments-spec.after.js | 21 ++ ...alidatesAccessibilityWithArguments-spec.js | 19 ++ .../element/ItValidatesElement-spec.after.js | 21 ++ .../element/ItValidatesElement-spec.js | 19 ++ ...lidatesElementWithArguments-spec.after.js} | 6 +- .../ItValidatesElementWithArguments-spec.js | 19 ++ ...lidatesElementWithBeforeHook-spec.after.js | 24 +++ .../ItValidatesElementWithBeforeHook-spec.js} | 8 +- ...ookAndDescribeBlockInBetween-spec.after.js | 29 +++ ...eforeHookAndDescribeBlockInBetween-spec.js | 27 +++ ...eforeHookAndItBlockInBetween-spec.after.js | 30 +++ ...tWithBeforeHookAndItBlockInBetween-spec.js | 28 +++ ...VarInBetweenBeforeHookMerged-spec.after.js | 27 +++ ...ookAndVarInBetweenBeforeHookMerged-spec.js | 26 +++ ...InBetweenBeforeHookUnchanged-spec.after.js | 28 +++ ...AndVarInBetweenBeforeHookUnchanged-spec.js | 26 +++ ...ementWithBeforeHookUnchanged-spec.after.js | 24 +++ ...atesElementWithBeforeHookUnchanged-spec.js | 22 ++ .../ItValidatesElementWithName-spec.after.js | 21 ++ .../ItValidatesElementWithName-spec.js | 19 ++ ...tesesWithImmediateBeforeHook-spec.after.js | 24 +++ ...ValidatesesWithImmediateBeforeHook-spec.js | 23 ++ ...ImmediateBeforeHookUnchanged-spec.after.js | 25 +++ ...esWithImmediateBeforeHookUnchanged-spec.js | 23 ++ ...sesWithNoImmediateBeforeHook-spec.after.js | 26 +++ ...lidatesesWithNoImmediateBeforeHook-spec.js | 24 +++ .../ItValidatesScreenshot-spec.after.js | 21 ++ .../screenshot/ItValidatesScreenshot-spec.js | 19 ++ ...datesScreenshotWithArguments-spec.after.js | 21 ++ ...ItValidatesScreenshotWithArguments-spec.js | 19 ++ ...tValidatesScreenshotWithName-spec.after.js | 21 ++ .../ItValidatesScreenshotWithName-spec.js | 19 ++ testdata/terra/projectroot/package.json | 6 + .../nameResolution/resolveDefaultName-spec.js | 21 -- ...DefaultNameForNonDefaultValidation-spec.js | 21 -- 206 files changed, 5108 insertions(+), 1553 deletions(-) create mode 100644 assets/replate_terra_it_quick_fix_before_hook_merged.png create mode 100644 assets/replate_terra_it_quick_fix_before_hook_unaltered.png create mode 100644 assets/replate_terra_it_quick_fix_simple.png rename docs/{terra_screenshots.md => terra_helpers.md} (53%) create mode 100644 src/main/java/com/picimako/terra/documentation/TerraQuickDocBundle.java delete mode 100644 src/main/java/com/picimako/terra/documentation/TerraWdioDocumentationService.java create mode 100644 src/main/java/com/picimako/terra/wdio/NoopResourceManager.java create mode 100644 src/main/java/com/picimako/terra/wdio/ScreenshotContextParser.java create mode 100644 src/main/java/com/picimako/terra/wdio/SpecFolderCollector.java create mode 100644 src/main/java/com/picimako/terra/wdio/TerraFunctionalTestingManager.java create mode 100644 src/main/java/com/picimako/terra/wdio/TerraFunctionalTestingScreenshotContextParser.java create mode 100644 src/main/java/com/picimako/terra/wdio/TerraResourceHandlerProvider.java create mode 100644 src/main/java/com/picimako/terra/wdio/TerraResourceManager.java create mode 100644 src/main/java/com/picimako/terra/wdio/TerraToolkitManager.java rename src/main/java/com/picimako/terra/wdio/{imagepreview/ScreenshotContextParser.java => TerraToolkitScreenshotContextParser.java} (50%) create mode 100644 src/main/java/com/picimako/terra/wdio/inspection/ReplaceTerraItWithTerraValidatesInspection.java create mode 100644 src/main/java/com/picimako/terra/wdio/screenshot/AbstractScreenshotNameResolver.java create mode 100644 src/main/java/com/picimako/terra/wdio/screenshot/ScreenshotNameResolver.java create mode 100644 src/main/java/com/picimako/terra/wdio/screenshot/TerraFunctionalTestingScreenshotNameResolver.java rename src/main/java/com/picimako/terra/wdio/screenshot/{TerraScreenshotNameResolver.java => TerraToolkitScreenshotNameResolver.java} (78%) create mode 100644 src/main/java/com/picimako/terra/wdio/screenshot/inspection/DuplicateScreenshotNameInspection.java create mode 100644 src/main/java/com/picimako/terra/wdio/screenshot/inspection/InvalidTerraValidationPropertiesInspection.java create mode 100644 src/main/java/com/picimako/terra/wdio/screenshot/inspection/MissingScreenshotNameInspection.java create mode 100644 src/main/java/com/picimako/terra/wdio/screenshot/inspection/TerraFunctionalTestingPropertiesProvider.java create mode 100644 src/main/java/com/picimako/terra/wdio/screenshot/inspection/TerraPropertiesProvider.java create mode 100644 src/main/java/com/picimako/terra/wdio/screenshot/inspection/TerraToolkitPropertiesProvider.java create mode 100644 src/main/java/com/picimako/terra/wdio/toolwindow/AbstractTerraWdioTreeModel.java delete mode 100644 src/main/java/com/picimako/terra/wdio/toolwindow/TerraWdioTree.java delete mode 100644 src/main/java/com/picimako/terra/wdio/toolwindow/TerraWdioTreeCellRenderer.java rename src/main/java/com/picimako/terra/wdio/toolwindow/{ => node}/AbstractTerraWdioTreeNode.java (72%) create mode 100644 src/main/java/com/picimako/terra/wdio/toolwindow/node/TerraWdioTree.java rename src/main/java/com/picimako/terra/wdio/toolwindow/{ => node}/TerraWdioTreeNode.java (69%) rename src/main/java/com/picimako/terra/wdio/toolwindow/{TerraWdioTreeModelDataRoot.java => node/TreeModelDataRoot.java} (68%) rename src/main/java/com/picimako/terra/wdio/toolwindow/{TerraWdioTreeScreenshotNode.java => node/TreeScreenshotNode.java} (80%) rename src/main/java/com/picimako/terra/wdio/toolwindow/{TerraWdioTreeSpecNode.java => node/TreeSpecNode.java} (76%) delete mode 100644 src/main/resources/com/picimako/terra/documentation/terra-wdio-docs.properties create mode 100644 src/main/resources/inspectionDescriptions/DuplicateScreenshotName.html create mode 100644 src/main/resources/inspectionDescriptions/InvalidTerraValidationProperties.html create mode 100644 src/main/resources/inspectionDescriptions/MissingScreenshotName.html create mode 100644 src/main/resources/inspectionDescriptions/ReplaceTerraItWithTerraValidates.html create mode 100644 src/main/resources/messages/TerraQuickDocBundle.properties create mode 100644 src/test/java/com/picimako/terra/TerraFunctionalTestingTestCase.java create mode 100644 src/test/java/com/picimako/terra/TerraToolkitTestCase.java create mode 100644 src/test/java/com/picimako/terra/wdio/TerraFunctionalTestingInspectionTestCase.java create mode 100644 src/test/java/com/picimako/terra/wdio/TerraFunctionalTestingSpecFolderCollectorTest.java create mode 100644 src/test/java/com/picimako/terra/wdio/TerraToolkitInspectionTestCase.java create mode 100644 src/test/java/com/picimako/terra/wdio/TerraToolkitSpecFolderCollectorTest.java create mode 100644 src/test/java/com/picimako/terra/wdio/imagepreview/TerraFunctionalTestingScreenshotContextParserTest.java create mode 100644 src/test/java/com/picimako/terra/wdio/inspection/ReplaceTerraItWithTerraValidatesInspectionForAccessibilityTest.java create mode 100644 src/test/java/com/picimako/terra/wdio/inspection/ReplaceTerraItWithTerraValidatesInspectionForScreenshotTest.java create mode 100644 src/test/java/com/picimako/terra/wdio/inspection/ReplaceTerraItWithTerraValidatesInspectionTest.java create mode 100644 src/test/java/com/picimako/terra/wdio/screenshot/TerraFunctionalTestingScreenshotNameResolverTest.java delete mode 100644 src/test/java/com/picimako/terra/wdio/screenshot/TerraScreenshotNameResolverTest.java create mode 100644 src/test/java/com/picimako/terra/wdio/screenshot/TerraToolkitScreenshotNameResolverTest.java create mode 100644 src/test/java/com/picimako/terra/wdio/screenshot/inspection/DuplicateScreenshotNameInspectionTest.java create mode 100644 src/test/java/com/picimako/terra/wdio/screenshot/inspection/InvalidTerraFTValidationPropertiesInspectionTest.java create mode 100644 src/test/java/com/picimako/terra/wdio/screenshot/inspection/InvalidTerraToolkitValidationPropertiesInspectionTest.java create mode 100644 src/test/java/com/picimako/terra/wdio/screenshot/inspection/MissingScreenshotNameInspectionTest.java create mode 100644 src/test/java/com/picimako/terra/wdio/screenshot/reference/TerraScreenshotCollectorFunctionalTestingTest.java rename src/test/java/com/picimako/terra/{documentation/TerraWdioDocumentationServiceTest.java => wdio/toolwindow/TerraWdioToolWindowFactoryNegativeTest.java} (53%) delete mode 100644 src/test/java/com/picimako/terra/wdio/toolwindow/TerraWdioTreeCellRendererTest.java create mode 100644 src/test/java/com/picimako/terra/wdio/toolwindow/TerraWdioTreeNodeRendererTest.java rename src/test/java/com/picimako/terra/wdio/toolwindow/{TerraWdioTreeModelDataRootTest.java => TreeModelDataRootTest.java} (53%) rename src/test/java/com/picimako/terra/wdio/toolwindow/{TerraWdioTreeScreenshotNodeTest.java => TreeScreenshotNodeTest.java} (72%) rename src/test/java/com/picimako/terra/wdio/toolwindow/{TerraWdioTreeSpecNodeTest.java => TreeSpecNodeTest.java} (83%) rename src/test/java/com/picimako/terra/wdio/toolwindow/action/{ScreenshotContextParserTest.java => TerraToolkitScreenshotContextParserTest.java} (73%) create mode 100644 testdata/terra/functestroot/package.json rename testdata/terra/{projectroot/tests/wdio/nameResolution/resolveDefaultNameWithTestId-spec.js => functestroot/tests/wdio/CollectScreenshots-spec.js} (78%) rename testdata/terra/{projectroot/tests/wdio/nameResolution/resolveDefaultNameNoParentDescribeName-spec.js => functestroot/tests/wdio/FindUnusedScreenshot-spec.js} (82%) create mode 100644 testdata/terra/functestroot/tests/wdio/__snapshots__/latest/clinical-lowlight-theme/en/chrome_huge/CollectScreenshots-spec/terra_screenshot.png create mode 100644 testdata/terra/functestroot/tests/wdio/__snapshots__/reference/clinical-lowlight-theme/en/chrome_medium/CollectScreenshots-spec/terra_screenshot.png create mode 100644 testdata/terra/functestroot/tests/wdio/__snapshots__/reference/terra-default-theme/en/chrome_huge/CollectScreenshots-spec/terra_screenshot.png create mode 100644 testdata/terra/functestroot/tests/wdio/__snapshots__/reference/terra-default-theme/en/chrome_huge/FindUnusedScreenshot-spec/terra_screenshot.png create mode 100644 testdata/terra/functestroot/tests/wdio/__snapshots__/reference/terra-default-theme/en/chrome_medium/CollectScreenshots-spec/terra_screenshot.png create mode 100644 testdata/terra/inspection/wdio/screenshot/DuplicateScreenshotName-spec.js create mode 100644 testdata/terra/inspection/wdio/screenshot/InvalidTerraValidationProperties-spec.js create mode 100644 testdata/terra/inspection/wdio/screenshot/InvalidTerraValidationPropertiesTerraFunctionalTesting-spec.js create mode 100644 testdata/terra/inspection/wdio/screenshot/MandatoryNameParameter-spec.js create mode 100644 testdata/terra/inspection/wdio/screenshot/TriplicateScreenshotName-spec.js create mode 100644 testdata/terra/inspection/wdio/screenshot/package.json rename testdata/terra/{projectroot/tests/wdio/nameResolution/resolveNameWithTestId-spec.js => inspection/wdio/screenshot/replaceit/accessibility/ItValidatesAccessibility-spec.after.js} (78%) rename testdata/terra/{projectroot/tests/wdio/nameResolution/resolveDefaultNameNoParentDescribe-spec.js => inspection/wdio/screenshot/replaceit/accessibility/ItValidatesAccessibility-spec.js} (84%) create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/accessibility/ItValidatesAccessibilityWithArguments-spec.after.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/accessibility/ItValidatesAccessibilityWithArguments-spec.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/element/ItValidatesElement-spec.after.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/element/ItValidatesElement-spec.js rename testdata/terra/{projectroot/tests/wdio/nameResolution/resolveNameWithNonMatchingTestId-spec.js => inspection/wdio/screenshot/replaceit/element/ItValidatesElementWithArguments-spec.after.js} (78%) create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/element/ItValidatesElementWithArguments-spec.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/element/ItValidatesElementWithBeforeHook-spec.after.js rename testdata/terra/{projectroot/tests/wdio/nameResolution/resolveNameWithMultipleTestIds-spec.js => inspection/wdio/screenshot/replaceit/element/ItValidatesElementWithBeforeHook-spec.js} (76%) create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/element/ItValidatesElementWithBeforeHookAndDescribeBlockInBetween-spec.after.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/element/ItValidatesElementWithBeforeHookAndDescribeBlockInBetween-spec.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/element/ItValidatesElementWithBeforeHookAndItBlockInBetween-spec.after.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/element/ItValidatesElementWithBeforeHookAndItBlockInBetween-spec.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/element/ItValidatesElementWithBeforeHookAndVarInBetweenBeforeHookMerged-spec.after.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/element/ItValidatesElementWithBeforeHookAndVarInBetweenBeforeHookMerged-spec.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/element/ItValidatesElementWithBeforeHookAndVarInBetweenBeforeHookUnchanged-spec.after.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/element/ItValidatesElementWithBeforeHookAndVarInBetweenBeforeHookUnchanged-spec.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/element/ItValidatesElementWithBeforeHookUnchanged-spec.after.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/element/ItValidatesElementWithBeforeHookUnchanged-spec.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/element/ItValidatesElementWithName-spec.after.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/element/ItValidatesElementWithName-spec.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/element/ItValidatesesWithImmediateBeforeHook-spec.after.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/element/ItValidatesesWithImmediateBeforeHook-spec.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/element/ItValidatesesWithImmediateBeforeHookUnchanged-spec.after.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/element/ItValidatesesWithImmediateBeforeHookUnchanged-spec.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/element/ItValidatesesWithNoImmediateBeforeHook-spec.after.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/element/ItValidatesesWithNoImmediateBeforeHook-spec.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/screenshot/ItValidatesScreenshot-spec.after.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/screenshot/ItValidatesScreenshot-spec.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/screenshot/ItValidatesScreenshotWithArguments-spec.after.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/screenshot/ItValidatesScreenshotWithArguments-spec.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/screenshot/ItValidatesScreenshotWithName-spec.after.js create mode 100644 testdata/terra/inspection/wdio/screenshot/replaceit/screenshot/ItValidatesScreenshotWithName-spec.js create mode 100644 testdata/terra/projectroot/package.json delete mode 100644 testdata/terra/projectroot/tests/wdio/nameResolution/resolveDefaultName-spec.js delete mode 100644 testdata/terra/projectroot/tests/wdio/nameResolution/resolveDefaultNameForNonDefaultValidation-spec.js diff --git a/CHANGELOG.md b/CHANGELOG.md index e04ed41..33c245d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +### 0.6.0 + +#### ADDED SUPPORT FOR TERRA-FUNCTIONAL-TESTING +[#53](https://github.com/picimako/terra-support/issues/53): Added support for the new terra-functional-testing npm package that brings +a couple of changes to how Terra wdio testing is conducted. + +Whether terra-functional-testing or terra-toolkit is used is determined by whether `@cerner/terra-functional-testing` or `terra-toolkit` +is included in the dependencies of the project's root package.json. If none of them is found, plugin features will not execute. + +Areas of changes: +- Updated the screenshot name resolution logic to use only the name argument of `Terra.validates` calls. This affected references, inlay hints, + navigation to screenshot usage actions and inspections. See [Terra Upgrade Guide/Screenshots](https://engineering.cerner.com/terra-ui/dev_tools/cerner/terra-functional-testing/upgrade-guides/version-1-upgrade-guide#screenshots). +- Updated screenshot context string resolution to include the theme in the context string. This affects the reference suggestions and the Diff and Reference/Latest previews. +- Unused screenshot seeking logic is updated as well. +- Screenshot gutter icons no longer suggest screenshots when the name argument of a `Terra.validates` call is missing, + since it is not a valid usage in terra-functional-testing. +- Inspections validating mismatch tolerance are updated to handle the renamed `mismatchTolerance` property along with `misMatchTolerance`. +- Various actions are updated to handle the new theme-specific folder structure. +- Added an inspection to report when the name parameter of a screenshot validation is missing. +- Added an inspection to report when more than one screenshot validation has the same name parameter, since these names must be unique. + +#### BUGFIX +- Fixed the disposal logic of the Terra wdio tree nodes. + ### 0.5.1 #### BUGFIX diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md index 6444ee5..86e134f 100644 --- a/CONTRIBUTE.md +++ b/CONTRIBUTE.md @@ -4,50 +4,32 @@ If you would like to contribute, first make sure to check out the document about ## Table of contents -- [Git branching](#git-branching) -- [How to add new File Templates](#how-to-add-new-file-templates) - [Implementing inspections](#implementing-inspections) - [Blocking vs. non-blocking inspection types](#blocking-vs-non-blocking-inspection-types) - [Steps to implement an inspection](#steps-to-implement-an-inspection) - [Unit testing](#unit-testing) - [Helper code snippets](#helper-code-snippets) -## Git branching - -When you start working on a separate Git branch, please make sure the branch is named according to its purpose as follows: - - /#- - -where branch_type may be `feature`, `bugfix` or `doc`, e.g. **feature/#23-add-new-inspection**. - -Commit messages doesn't have to contain the issue numbers. - -## How to add new File Templates - -In order to add File Template under *Settings > Editor > File and Code Template > Files tab*, place your template file under `src/main/resources/fileTemplates`. - -The file must be named as follows: `