我在gitlab上使用以下yaml文件进行此过程:
public class rotate3Dwithpanel extends Application
{
private double mouseOldX, mouseOldY = 0;
private Rotate rotateX = new Rotate(0, Rotate.X_AXIS);
private Rotate rotateY = new Rotate(0, Rotate.Y_AXIS);
private Rotate rotateZ = new Rotate(0, Rotate.Z_AXIS);
@Override
public void start(Stage stage) throws Exception
{
final PhongMaterial redMaterial = new PhongMaterial();
redMaterial.setSpecularColor(Color.ORANGE);
redMaterial.setDiffuseColor(Color.RED);
Box myBox = new Box(100, 100, 100);
myBox.setTranslateX(400);
myBox.setTranslateY(300);
myBox.setTranslateZ(400);
myBox.setMaterial(redMaterial);
Rectangle rectangle = new Rectangle();
rectangle.setX(200);
rectangle.setY(600);
rectangle.setWidth(200);
rectangle.setHeight(100);
rectangle.setFill(Color.GREY);
// to Set pivot points
rotateX.setPivotX(400);
rotateX.setPivotY(300);
rotateX.setPivotZ(400);
rotateY.setPivotX(400);
rotateY.setPivotY(300);
rotateY.setPivotZ(400);
rotateZ.setPivotX(400);
rotateZ.setPivotY(300);
rotateZ.setPivotZ(400);
// initialize the camera
PerspectiveCamera camera = new PerspectiveCamera(false);
camera.getTransforms().addAll (rotateX, rotateY, new Translate(0, 0, 0));
Group root = new Group();
Group subRoot = new Group();
root.getChildren().add(rectangle);
Scene scene = new Scene(root, 1000, 1000, true);
SubScene subScene = new SubScene(subRoot, 800, 800, true, SceneAntialiasing.BALANCED);
subScene.setCamera(camera);
subRoot.getChildren().add(myBox);
root.getChildren().add(subScene);
// events for rotation
rectangle.setOnMousePressed(event -> {
mouseOldX = event.getSceneX();
mouseOldY = event.getSceneY();
});
rectangle.setOnMouseDragged(event -> {
if(event.isPrimaryButtonDown())
{
rotateX.setAngle(rotateX.getAngle() - (event.getSceneY() - mouseOldY));
rotateY.setAngle(rotateY.getAngle() + (event.getSceneX() - mouseOldX));
mouseOldX = event.getSceneX();
mouseOldY = event.getSceneY();
}
});
stage.setTitle("JavaFX 3D Object");
stage.setScene(scene);
stage.show();
}
public static void main(String[] args)
{
launch(args);
}
}
这基本上运行了使用量角器的项目的e2e测试(selenium webdriver framwork,它使用外部硒网格)。运行此类测试后,将使用带有屏幕截图的.html报告创建文件夹。
我想要实现的目标是能够在构建失败时发送附有该文件夹的电子邮件,或者(可能首先从每次执行开始)。有任何想法如何从该docker机器实现这一点?