All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.serenitybdd.core.photography.PhotoSessionBooking Maven / Gradle / Ivy

There is a newer version: 4.2.8
Show newest version
package net.serenitybdd.core.photography;

import com.google.common.base.Preconditions;
import net.serenitybdd.annotations.BlurLevel;
import java.nio.file.Path;

public class PhotoSessionBooking {

    private final Darkroom darkroom;
    private PhotoLens lens;
    private Path outputDirectory;
    private BlurLevel blurLevel;

    public PhotoSessionBooking(Darkroom darkroom) {
        this.darkroom = darkroom;
    }

    public PhotoSessionBooking with(PhotoLens lens) {
        this.lens = lens;
        return this;
    }

    public PhotoSessionBooking andWithBlurring(BlurLevel blurLevel) {
        this.blurLevel = blurLevel;
        return this;
    }

    public PhotoSessionBooking toDirectory(Path outputDirectory) {
        this.outputDirectory = outputDirectory;
        return this;
    }

    public ScreenshotPhoto takeScreenshot() {
        Preconditions.checkNotNull(lens);
        Preconditions.checkNotNull(outputDirectory);
        return inPhotoSession().takeScreenshot();
    }

    private PhotoSession inPhotoSession() {
        return new PhotoSession(lens, darkroom, outputDirectory, blurLevel);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy