You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: admin_role_test.rb
    path of file: ./repos/zammad/test/browser
    
    the code of the file until where you have to start completion: # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/

require 'browser_test_helper'

class AdminRoleTest < TestCase
  def test_role_device
    @browser = browser_instance
    login(
      username: 'admin@example.com',
      password: 'test',
      url:      browser_url,
    )
    tasks_close_all

    rand      = SecureRandom.uuid
    login     = "agent-role-#{rand}"
    firstname = "Role#{rand}"
    lastname  = "Module#{rand}"
    email     = "agent-role-#{rand}@example.com"
    password  = 'agentpw'

    user_create(
      data: {
        login:     login,
        firstname: firstname,
        lastname:  lastname,
        email:     email,
        password:  password,
      },
    )

    name = "somerole#{rand}"
    role_create(
      data: {
        name:              name,
        default_at_signup: false,
        permission:        [
          'admin.group',
          'user_preferences.device',
        ],
        member:            [login],
      }
    )

    logout
    # flanky
    login(
      username: email,
      password: password,
      url:      browser_url,
    )
    tasks_close_all
    click(css: 'a[href="#current_user"]')
    click(css: 'a[href="#profile"]')
    match(
      css:   '.content .NavBarProfile',
      value: 'Password',
    )
    match(
      css:   '.content .NavBarProfile',
      value: 'Language',
    )
    match_not(
      css:   '.content .NavBarProfile',
      value: 'Notifications',
    )
    match_not(
      css:   '.content .NavBarProfile',
      value: 'Calendar',
    )
    match_not(
      css:   '.content .NavBarProfile',
      value: 'Token Access',
    )
    
  def test_role_admin_user

    @browser = browser_instance

    login(
      username: 'agent1@example.com',
      password: 'test',
      url:      browser_url,
    )

    # check if admin exists
    exists_not(css: '[href="#manage"]')
    logout

    # add admin.user to agent role
    login(
      username: 'admin@example.com',
      password: 'test',
      url:      browser_url,
    )
    tasks_close_all

    role_edit(
      data: {
        name:       'Agent',
        active:     true,
        permission: {
          'admin.user'       => true,
          'chat.agent'       => true,
          'cti.agent'        => true,
          'ticket.agent'     => true,
          'user_preferences' => true,
        },
      }
    )
    logout

    # check if admin exists
    login(
      username: 'agent1@example.com',
      password: 'test',
      url:      browser_url,
    )
    tasks_close_all

    # create user
    random = SecureRandom.uuid
    user_email = "admin.user.#{random}@example.com"
    user_create(
      data: {
        # login:    "some login #{random}",
        firstname: "Admin.User Firstname #{random}",
        lastname:  "Admin.User Lastname #{random}",
        email:     user_email,
        password:  'some-pass',
      },
    )

    # create ticket for user
    ticket_create(
      data: {
        customer: user_email,
        group:    'Users',
        title:    'some changes',
        body:     'some body 123äöü - admin.user',
      },
    )

    # revoke admin.user
    logout
    login(
      username: 'admin@example.com',
      password: 'test',
      url:      browser_url,
    )
    tasks_close_all

    role_edit(
      data: {
        name:       'Agent',
        active:     true,
        permission: {
          'admin.user'       => false,
          'chat.agent'       => true,
          'cti.agent'        => true,
          'ticket.agent'     => true,
          'user_preferences' => true,
        },
      }
    )
    logout

    login(
      username: 'agent1@example.com',
      password: 'test',
      url:      browser_url,
    )

    # check if admin exists
    exists_not(css: '[href="#manage"]')

  end