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

org.openqa.selenium.devtools.animation.Animation Maven / Gradle / Ivy

Go to download

Selenium automates browsers. That's it! What you do with that power is entirely up to you.

There is a newer version: 4.0.0-rc-1
Show newest version
package org.openqa.selenium.devtools.animation;

import org.openqa.selenium.Beta;
import org.openqa.selenium.devtools.Command;
import org.openqa.selenium.devtools.Event;
import org.openqa.selenium.devtools.ConverterFunctions;
import com.google.common.collect.ImmutableMap;
import org.openqa.selenium.json.JsonInput;

@Beta()
public class Animation {

    /**
     * Disables animation domain notifications.
     */
    public static Command disable() {
        ImmutableMap.Builder params = ImmutableMap.builder();
        return new Command<>("Animation.disable", params.build());
    }

    /**
     * Enables animation domain notifications.
     */
    public static Command enable() {
        ImmutableMap.Builder params = ImmutableMap.builder();
        return new Command<>("Animation.enable", params.build());
    }

    /**
     * Returns the current time of the an animation.
     */
    public static Command getCurrentTime(java.lang.String id) {
        java.util.Objects.requireNonNull(id, "id is required");
        ImmutableMap.Builder params = ImmutableMap.builder();
        params.put("id", id);
        return new Command<>("Animation.getCurrentTime", params.build(), ConverterFunctions.map("currentTime", java.lang.Number.class));
    }

    /**
     * Gets the playback rate of the document timeline.
     */
    public static Command getPlaybackRate() {
        ImmutableMap.Builder params = ImmutableMap.builder();
        return new Command<>("Animation.getPlaybackRate", params.build(), ConverterFunctions.map("playbackRate", java.lang.Number.class));
    }

    /**
     * Releases a set of animations to no longer be manipulated.
     */
    public static Command releaseAnimations(java.util.List animations) {
        java.util.Objects.requireNonNull(animations, "animations is required");
        ImmutableMap.Builder params = ImmutableMap.builder();
        params.put("animations", animations);
        return new Command<>("Animation.releaseAnimations", params.build());
    }

    /**
     * Gets the remote object of the Animation.
     */
    public static Command resolveAnimation(java.lang.String animationId) {
        java.util.Objects.requireNonNull(animationId, "animationId is required");
        ImmutableMap.Builder params = ImmutableMap.builder();
        params.put("animationId", animationId);
        return new Command<>("Animation.resolveAnimation", params.build(), ConverterFunctions.map("remoteObject", org.openqa.selenium.devtools.runtime.model.RemoteObject.class));
    }

    /**
     * Seek a set of animations to a particular time within each animation.
     */
    public static Command seekAnimations(java.util.List animations, java.lang.Number currentTime) {
        java.util.Objects.requireNonNull(animations, "animations is required");
        java.util.Objects.requireNonNull(currentTime, "currentTime is required");
        ImmutableMap.Builder params = ImmutableMap.builder();
        params.put("animations", animations);
        params.put("currentTime", currentTime);
        return new Command<>("Animation.seekAnimations", params.build());
    }

    /**
     * Sets the paused state of a set of animations.
     */
    public static Command setPaused(java.util.List animations, java.lang.Boolean paused) {
        java.util.Objects.requireNonNull(animations, "animations is required");
        java.util.Objects.requireNonNull(paused, "paused is required");
        ImmutableMap.Builder params = ImmutableMap.builder();
        params.put("animations", animations);
        params.put("paused", paused);
        return new Command<>("Animation.setPaused", params.build());
    }

    /**
     * Sets the playback rate of the document timeline.
     */
    public static Command setPlaybackRate(java.lang.Number playbackRate) {
        java.util.Objects.requireNonNull(playbackRate, "playbackRate is required");
        ImmutableMap.Builder params = ImmutableMap.builder();
        params.put("playbackRate", playbackRate);
        return new Command<>("Animation.setPlaybackRate", params.build());
    }

    /**
     * Sets the timing of an animation node.
     */
    public static Command setTiming(java.lang.String animationId, java.lang.Number duration, java.lang.Number delay) {
        java.util.Objects.requireNonNull(animationId, "animationId is required");
        java.util.Objects.requireNonNull(duration, "duration is required");
        java.util.Objects.requireNonNull(delay, "delay is required");
        ImmutableMap.Builder params = ImmutableMap.builder();
        params.put("animationId", animationId);
        params.put("duration", duration);
        params.put("delay", delay);
        return new Command<>("Animation.setTiming", params.build());
    }

    public static Event animationCanceled() {
        return new Event<>("Animation.animationCanceled", ConverterFunctions.map("id", java.lang.String.class));
    }

    public static Event animationCreated() {
        return new Event<>("Animation.animationCreated", ConverterFunctions.map("id", java.lang.String.class));
    }

    public static Event animationStarted() {
        return new Event<>("Animation.animationStarted", ConverterFunctions.map("animation", org.openqa.selenium.devtools.animation.model.Animation.class));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy