package cz.moneta.test.dsl.salesforce.pages.accounts;

import cz.moneta.test.dsl.salesforce.components.ListViewHeader;
import cz.moneta.test.harness.context.StoreAccessor;
import cz.moneta.test.harness.endpoints.sales_force.SalesForceEndpoint;
import cz.moneta.test.harness.support.web.CustomAction;
import cz.moneta.test.harness.support.web.Key;
import cz.moneta.test.harness.support.web.WebFlow;

public interface AccountsListPage extends WebFlow<AccountsListPage>, ListViewHeader, StoreAccessor {

    @CustomAction
    default AccountsListPage searchAccount(String account) {
        SalesForceEndpoint endpoint = getEndpoint(SalesForceEndpoint.class);
        endpoint.type(() -> ACCOUNT_SEARCH_INPUT, account, false);
        endpoint.sendKeysOneAtATime(Key.ENTER);
        return null;
    }
}
