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

io.magentys.fest.missions.FindElement Maven / Gradle / Ivy

There is a newer version: 1.0.6
Show newest version
package io.magentys.fest.missions;

import io.magentys.Agent;
import io.magentys.Mission;
import io.magentys.fest.MemoryKeys;
import io.magentys.fest.screens.SwingScreenElement;
import org.assertj.swing.core.ComponentFoundCondition;
import org.assertj.swing.core.Robot;
import org.assertj.swing.fixture.FrameFixture;
import org.assertj.swing.timing.Pause;


import static io.magentys.fest.missions.ConcreteTypeMatcher.matcherFor;

public class FindElement extends AbstractFinderMission implements Mission {

    protected final SwingScreenElement swingScreenElement;

    public FindElement(SwingScreenElement swingScreenElement) {
        this.swingScreenElement = swingScreenElement;
    }

    @Override
    public Agent accomplishAs(Agent agent) {
        final Robot robot = agent.recalls(MemoryKeys.Screens.ROBOT, Robot.class);
        Pause.pause(
                new ComponentFoundCondition(waitMessage(swingScreenElement),
                        robot.finder(),
                        matcherFor(swingScreenElement)),
                60000);
        return agent;
    }






}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy