net.serenitybdd.screenplay.actions.KeyNames Maven / Gradle / Ivy
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);
}
}