Package step.plugins.cypress
Class AbstractCypressSession
- java.lang.Object
-
- step.plugins.cypress.AbstractCypressSession
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
CypressCommandRunnerSession
,CypressSpecRunnerSession
public abstract class AbstractCypressSession extends java.lang.Object implements java.io.Closeable
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.regex.Pattern
CYPRESS_VERSION_PATTERN
protected CypressSessionManager
cypressSessionManager
static java.lang.String
DEFAULT_CYPRESS_VERSION
protected int
detectedCypressVersion
protected java.lang.String
id
protected java.io.File
projectFile
protected java.nio.file.Path
projectPath
protected java.nio.file.Path
screenshotPath
-
Constructor Summary
Constructors Constructor Description AbstractCypressSession(CypressSessionManager cypressSessionManager, java.io.File projectFile)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
protected java.util.List<byte[]>
collectScreenshots(java.lang.String specFilename)
protected java.lang.String
ensureCypressExeIsExecutable()
protected java.nio.file.Path
getCypressExe()
java.lang.String
getId()
protected void
readCypressVersion(java.lang.String cypressExe)
protected static java.lang.String
readProcessLog(java.io.File file)
protected StatusAndLog
runCommand(java.lang.String npm, java.util.List<java.lang.String> command)
protected StatusAndLog
runCommand(java.lang.String npm, java.util.List<java.lang.String> command, java.util.Map<java.lang.String,java.lang.String> environmentVariable)
protected void
runCypressInstall(java.lang.String cypressExe)
protected void
runNpmInstallIfPackageJsonAvailable()
-
-
-
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
-
cypressSessionManager
protected final CypressSessionManager cypressSessionManager
-
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 interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.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)
-
-