Class AbstractCypressSession

    • Field Detail

      • CYPRESS_VERSION_PATTERN

        public static final java.util.regex.Pattern CYPRESS_VERSION_PATTERN
      • DEFAULT_CYPRESS_VERSION

        public static final java.lang.String DEFAULT_CYPRESS_VERSION
        See Also:
        Constant Field Values
      • id

        protected final java.lang.String id
      • projectFile

        protected final java.io.File projectFile
      • projectPath

        protected java.nio.file.Path projectPath
      • detectedCypressVersion

        protected int detectedCypressVersion
      • screenshotPath

        protected java.nio.file.Path screenshotPath
    • Constructor Detail

      • AbstractCypressSession

        public AbstractCypressSession​(CypressSessionManager cypressSessionManager,
                                      java.io.File projectFile)
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • readProcessLog

        protected static java.lang.String readProcessLog​(java.io.File file)
      • getId

        public java.lang.String getId()
      • runNpmInstallIfPackageJsonAvailable

        protected void runNpmInstallIfPackageJsonAvailable()
                                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • getCypressExe

        protected java.nio.file.Path getCypressExe()
      • ensureCypressExeIsExecutable

        protected java.lang.String ensureCypressExeIsExecutable()
      • runCypressInstall

        protected void runCypressInstall​(java.lang.String cypressExe)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • readCypressVersion

        protected void readCypressVersion​(java.lang.String cypressExe)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • runCommand

        protected StatusAndLog runCommand​(java.lang.String npm,
                                          java.util.List<java.lang.String> command)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • runCommand

        protected StatusAndLog runCommand​(java.lang.String npm,
                                          java.util.List<java.lang.String> command,
                                          java.util.Map<java.lang.String,​java.lang.String> environmentVariable)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • collectScreenshots

        protected java.util.List<byte[]> collectScreenshots​(java.lang.String specFilename)