Appium

 view release on metacpan or  search on metacpan

lib/Appium.pm  view on Meta::CPAN

sub lock {
    my ($self, $seconds) = @_;

    my $res = { command => 'lock' };
    my $params = { seconds => $seconds };

    return $self->_execute_command( $res, $params );
}


sub is_locked {
    my($self) = @_;

    my $res = { command => 'is_locked' };
    return $self->_execute_command( $res );
}


sub shake {
    my ($self) = @_;

    my $res = { command => 'shake' };
    return $self->_execute_command( $res );
}

lib/Appium.pm  view on Meta::CPAN

encoded.

    $appium->end_test_coverage( 'intent', '/path/to/coverage.ec' );

=head2 lock ( $seconds )

Lock the device for a specified number of seconds.

    $appium->lock( 5 ); # lock for 5 seconds

=head2 is_locked

Query the device for its locked/unlocked state.

    $locked = $appium->is_locked

=head2 shake ()

Shake the device.

    $appium->shake;

=head2 open_notifications ()

Android only, API level 18 and above: open the notification shade on

lib/Appium/Commands.pm  view on Meta::CPAN

            end_test_coverage => {
                method => 'POST',
                url => 'session/:sessionId/appium/app/end_test_coverage',
                no_content_success => 1
            },
            lock => {
                method => 'POST',
                url => 'session/:sessionId/appium/device/lock',
                no_content_success => 1
            },
            is_locked => {
                method => 'POST',
                url => 'session/:sessionId/appium/device/is_locked',
                no_content_success => 0
            },
            shake => {
                method => 'POST',
                url => 'session/:sessionId/appium/device/shake',
                no_content_success => 1
            },
            reset => {
                method => 'POST',
                url => 'session/:sessionId/appium/app/reset',

t/Appium.t  view on Meta::CPAN

    endpoint_ok('background_app', [ 5 ], { seconds => 5 });
    endpoint_ok('is_app_installed', [ 'a fake bundle id' ], { bundleId => 'a fake bundle id' });
    endpoint_ok('install_app', [ '/fake/path/to.app' ], { appPath => '/fake/path/to.app' });
    endpoint_ok('remove_app', [ '/fake/path/to.app' ], { appId => '/fake/path/to.app' });
    endpoint_ok('launch_app');
    endpoint_ok('close_app');
}

DEVICE: {
    endpoint_ok('lock', [ 5 ], { seconds => 5 });
    endpoint_ok('is_locked');
    endpoint_ok('shake');
    endpoint_ok('open_notifications');
    endpoint_ok('network_connection');
    endpoint_ok('set_network_connection', [ 6 ], { parameters => { type => 6 } });
}

MISC: {
    endpoint_ok('end_test_coverage', [ 'intent', 'path' ], {
        intent => 'intent',
        path => 'path'

t/Commands.t  view on Meta::CPAN

                        complex_find
                        contexts
                        current_activity
                        current_context
                        end_test_coverage
                        hide_keyboard
                        install_app
                        is_app_installed
                        launch_app
                        lock
                        is_locked
                        network_connection
                        open_notifications
                        press_keycode
                        pull_file
                        pull_folder
                        push_file
                        long_press_keycode
                        remove_app
                        reset
                        set_network_connection



( run in 1.067 second using v1.01-cache-2.11-cpan-49f99fa48dc )