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

net.serenitybdd.screenplay.actions.KeyNames Maven / Gradle / Ivy

There is a newer version: 4.2.8
Show newest version
package net.serenitybdd.screenplay.actions;

import org.openqa.selenium.Keys;

import java.util.List;
import java.util.stream.Collectors;

public class KeyNames {
    public static List of(List keys) {
        return keys.stream().map(Enum::name).collect(Collectors.toList());
    }

    public static List lastTwoOf(List keys) {
        List pressedKeys = of(keys);
        return pressedKeys.subList(pressedKeys.size() - 2, pressedKeys.size());
    }

    public static List allButLastTwo(List keys) {
        List pressedKeys = of(keys);
        return pressedKeys.subList(0, pressedKeys.size() - 2);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy