mbolotov / intellij-cypress

IntelliJ-Cypress plugin: https://plugins.jetbrains.com/plugin/13819-intellij-cypress Pro version: https://plugins.jetbrains.com/plugin/13987-cypress-support-pro
MIT License
35 stars 5 forks source link

Unable to save plugin settings #85

Closed przemeklach closed 2 years ago

przemeklach commented 2 years ago

I am running Cypress Component tests with arguments: --headless -b electron

The build and test runs correctly but at the end I get the two following errors:

java.lang.NoClassDefFoundError: com/github/kklisura/cdt/services/types/ChromeTab at java.base/java.lang.Class.getDeclaredMethods0(Native Method) at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3166) at java.base/java.lang.Class.privateGetPublicMethods(Class.java:3191) at java.base/java.lang.Class.getMethods(Class.java:1904) at com.intellij.serialization.PropertyCollector.collectPropertyAccessors(PropertyCollector.java:104) at com.intellij.serialization.PropertyCollector.doCollect(PropertyCollector.java:63) at com.intellij.util.xmlb.BeanBinding$XmlSerializerPropertyCollectorListClassValue.computeValue(BeanBinding.java:384) at com.intellij.util.xmlb.BeanBinding$XmlSerializerPropertyCollectorListClassValue.computeValue(BeanBinding.java:374) at java.base/java.lang.ClassValue.getFromHashMap(ClassValue.java:228) at java.base/java.lang.ClassValue.getFromBackup(ClassValue.java:210) at java.base/java.lang.ClassValue.get(ClassValue.java:116) at com.intellij.util.xmlb.BeanBinding$XmlSerializerPropertyCollector.collect(BeanBinding.java:58) at com.intellij.util.xmlb.BeanBinding.getAccessors(BeanBinding.java:360) at com.intellij.util.xmlb.BeanBinding.init(BeanBinding.java:69) at com.intellij.util.xmlb.XmlSerializerImpl$XmlSerializer.getRootBinding(XmlSerializerImpl.java:117) at com.intellij.util.xmlb.XmlSerializer.getBeanBinding(XmlSerializer.java:88) at com.intellij.util.xmlb.XmlSerializer.serializeInto(XmlSerializer.java:100) at com.intellij.util.xmlb.XmlSerializer.serializeInto(XmlSerializer.java:92) at me.mbolotov.cypress.run.CypressRunConfig.writeExternal(Unknown Source) at com.intellij.execution.impl.RunnerAndConfigurationSettingsImplKt.serializeConfigurationInto(RunnerAndConfigurationSettingsImpl.kt:599) at com.intellij.execution.impl.RunnerAndConfigurationSettingsImpl.writeExternal(RunnerAndConfigurationSettingsImpl.kt:287) at com.intellij.execution.impl.RunnerAndConfigurationSettingsImpl.writeScheme(RunnerAndConfigurationSettingsImpl.kt:323) at com.intellij.execution.impl.BaseRCSettingsConfigurable.isModified(BaseRCSettingsConfigurable.java:46) at com.intellij.execution.impl.SingleConfigurationConfigurable.isModified(SingleConfigurationConfigurable.java:52) at com.intellij.execution.impl.RunConfigurable.isModified(RunConfigurable.kt:703) at com.intellij.openapi.options.ex.SingleConfigurableEditor$ApplyAction.actionPerformed(SingleConfigurableEditor.java:208) at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967) at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308) at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405) at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:270) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6654) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345) at java.desktop/java.awt.Component.processEvent(Component.java:6419) at java.desktop/java.awt.Container.processEvent(Container.java:2263) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5029) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2790) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:891) at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:820) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:757) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:498) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:117) at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190) at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235) at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233) at java.desktop/java.awt.Dialog.show(Dialog.java:1070) at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:701) at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:437) at com.intellij.openapi.ui.DialogWrapper.doShow(DialogWrapper.java:1671) at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1629) at com.intellij.execution.actions.EditRunConfigurationsAction.actionPerformed(EditRunConfigurationsAction.java:30) at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAwareWithCallbacks$4(ActionUtil.java:244) at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:265) at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:244) at com.intellij.ui.popup.ActionPopupStep.performAction(ActionPopupStep.java:253) at com.intellij.ui.popup.ActionPopupStep.performAction(ActionPopupStep.java:243) at com.intellij.ui.popup.ActionPopupStep.lambda$onChosen$2(ActionPopupStep.java:229) at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94) at com.intellij.ui.popup.AbstractPopup.lambda$dispose$18(AbstractPopup.java:1508) at com.intellij.util.ui.EdtInvocationManager.invokeLaterIfNeeded(EdtInvocationManager.java:101) at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.java:186) at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.java:140) at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:175) at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.doWhenFocusSettlesDown(IdeFocusManagerImpl.java:36) at com.intellij.ui.popup.AbstractPopup.dispose(AbstractPopup.java:1505) at com.intellij.ui.popup.WizardPopup.dispose(WizardPopup.java:164) at com.intellij.ui.popup.list.ListPopupImpl.dispose(ListPopupImpl.java:326) at com.intellij.ui.popup.PopupFactoryImpl$ActionGroupPopup.dispose(PopupFactoryImpl.java:271) at com.intellij.openapi.util.ObjectTree.runWithTrace(ObjectTree.java:139) at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:169) at com.intellij.openapi.util.Disposer.dispose(Disposer.java:217) at com.intellij.openapi.util.Disposer.dispose(Disposer.java:205) at com.intellij.ui.popup.WizardPopup.disposeAllParents(WizardPopup.java:268) at com.intellij.ui.popup.list.ListPopupImpl.handleNextStep(ListPopupImpl.java:433) at com.intellij.ui.popup.list.ListPopupImpl._handleSelect(ListPopupImpl.java:405) at com.intellij.ui.popup.list.ListPopupImpl.handleSelect(ListPopupImpl.java:361) at com.intellij.ui.popup.PopupFactoryImpl$ActionGroupPopup.handleSelect(PopupFactoryImpl.java:288) at com.intellij.ui.popup.list.ListPopupImpl$MyMouseListener.mouseReleased(ListPopupImpl.java:618) at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:298) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6654) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345) at com.intellij.ui.popup.list.ListPopupImpl$MyList.processMouseEvent(ListPopupImpl.java:695) at java.desktop/java.awt.Component.processEvent(Component.java:6419) at java.desktop/java.awt.Container.processEvent(Container.java:2263) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5029) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2790) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:891) at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:820) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:757) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:498) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) Caused by: java.lang.ClassNotFoundException: com.github.kklisura.cdt.services.types.ChromeTab PluginClassLoader(plugin=PluginDescriptor(name=Cypress Support Pro, id=me.mbolotov.cypress.pro, descriptorPath=plugin.xml, path=~/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/213.6777.52/IntelliJ IDEA.app.plugins/cypress-pro-2.6.jar, version=2.6, package=null, isBundled=false), packagePrefix=null, instanceId=358, state=active) at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:235) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ... 144 more

Unable to save plugin settings The plugin me.mbolotov.cypress.pro failed to save settings and has been disabled. Please restart IntelliJ IDEA

This last error message I also see when I just go into and out of Settings/Plugins.

I'm on MacOS 12.3 and IntelliJ 2021.3.2.

I'm using the trial version of the plugin on version 2.6

mbolotov commented 2 years ago

Hi @przemeklach! This issue looks hazy and obscure for me. Can it be reproduced stably on your side?

Could you provide the content of your run configuration stored inside <project>/.idea/workspace.xml? The one with type="CypressConfigurationType" and the proper name field. The following is a clipped example of my run configuration:

<configuration name="Actions .type() - type into a DOM element" type="CypressConfigurationType" factoryName="Cypress" temporary="true" nameIsGenerated="true" show_console_on_std_err="false" show_console_on_std_out="false">
      <option name="allowRunningInParallel" value="true" />
        <...>
</configuration>

Please note there could be some sensitive information (e.g. folder and file names) that you may want to hide before posting.

przemeklach commented 2 years ago

My run configuration does not contain a CypressConfigurationType entry. When I try to add a new Cypress run configuration and press 'OK' nothing happens. Clicking 'Cancel' also does nothing. It's like the buttons stop working. The only way I can close the configuration dialog is by clicking x. When I do click 'OK' the first time I see the following message in the event log:

Unable to save plugin settings: The plugin me.mbolotov.cypress.pro failed to save settings and has been disabled. Please restart IntelliJ IDEA

It looks to me like it's unable to save the run configuration. From the log message it is unclear as to why.

mbolotov commented 2 years ago

I was able to reproduce the saving failure issue by removing cdt-java-client-2.1.0.jar from plugin installation. Please ensure you have this jar file within the plugin bundle. You can find it at the following path: $IDE_ROOT/plugins/Cypress Support Pro/lib where IDE_ROOT can be found as described here: https://intellij-support.jetbrains.com/hc/en-us/articles/206544519-Directories-used-by-the-IDE-to-store-settings-caches-plugins-and-logs

Please also check if something can block loading Chrome Development Tools libraries on OS level (antivirus software etc.)

przemeklach commented 2 years ago

Initially I used the IntelliJ plugin manager to install the plugin from disk but that only copied over the cypress jar and none of its dependencies.

I manually copied all the jars out of the lib folder into the plugin folder of IntelliJ. Not sure if that is correct since I was unable to find any instructions on how to install the free version of the plugin: the link just took me to the download page.

I also installed homebrew/cask-versions/google-chrome-dev but I'm still getting: missing java.lang.NoClassDefFoundError: com/github/kklisura/cdt/services/types/ChromeTab.

I don't know how to check if the dev tools is being blocked.

mbolotov commented 2 years ago

I would rather try to install the plugin directly from marketplace as it described here image

przemeklach commented 2 years ago

Ok I did that and I was able to successfully add the configuration.

I do not see an option for running component tests. Is this something that is only available in the Pro version?

mbolotov commented 2 years ago

yep, some features are available in the Pro version only. here is the comparison table (it's not yet updated to reflect the component test run): image

przemeklach commented 2 years ago

Ok great. Thanks for your help.

Perhaps the instructions on the free version of the plugin site should be updated to direct users to use the plugin manager in IntelliJ. Currently it takes you to the download page which lead me down this bad path ref: https://plugins.jetbrains.com/plugin/13819-cypress-support

mbolotov commented 2 years ago

Probably they should be. Which plugin site do you mean exactly?

przemeklach commented 2 years ago

The one listed here: https://plugins.jetbrains.com/plugin/13819-cypress-support.

When you click on 'Get' it takes you to the download page with no instructions.

mbolotov commented 2 years ago

well, it's a JetBrains marketplace page, so I have limited ability to edit it. However, there is a download button that will open a download window directly in a running IDE image

przemeklach commented 2 years ago

Interesting. I see something different. Screen Shot 2022-03-18 at 11 27 26

mbolotov commented 2 years ago

I mean this button is shown after you click Get there