github.com/henvic/wedeploycli@v1.7.6-0.20200319005353-3630f582f284/functional/tests/loggedout.exp (about)

     1  #!/usr/bin/expect
     2  
     3  spawn $env(SHELL)
     4  logout $::_tester(email)
     5  
     6  Feature: "Logged out"
     7  
     8  Scenario: "Cannot list without logging in" {
     9    send "$::bin list\r"
    10    expect {
    11      timeout { handle_timeout; break }
    12      "You need to log in before using \"lcp list\"."
    13    }
    14    expect {
    15      timeout { handle_timeout; break }
    16      "Open your browser and authenticate?"
    17    }
    18    send "n\r"
    19    expect {
    20      timeout { handle_timeout; break }
    21      "Login canceled."
    22    }
    23  }
    24  
    25  Scenario: "Cannot deploy without logging in" {
    26    send "$::bin deploy\r"
    27    expect {
    28      timeout { handle_timeout; break }
    29      "You need to log in before using \"lcp deploy\"."
    30    }
    31    expect {
    32      timeout { handle_timeout; break }
    33      "Open your browser and authenticate?"
    34    }
    35    send "n\r"
    36    expect {
    37      timeout { handle_timeout; break }
    38      "Login canceled."
    39    }
    40  }
    41  
    42  Scenario: "Cannot view log without logging in" {
    43    send "$::bin log\r"
    44    expect {
    45      timeout { handle_timeout; break }
    46      "You need to log in before using \"lcp log\"."
    47    }
    48    expect {
    49      timeout { handle_timeout; break }
    50      "Open your browser and authenticate?"
    51    }
    52    send "n\r"
    53    expect {
    54      timeout { handle_timeout; break }
    55      "Login canceled."
    56    }
    57  }
    58  
    59  Scenario: "Cannot restart without logging in" {
    60    send "$::bin restart\r"
    61    expect {
    62      timeout { handle_timeout; break }
    63      "You need to log in before using \"lcp restart\"."
    64    }
    65    expect {
    66      timeout { handle_timeout; break }
    67      "Open your browser and authenticate?"
    68    }
    69    send "n\r"
    70    expect {
    71      timeout { handle_timeout; break }
    72      "Login canceled."
    73    }
    74  }
    75  
    76  Scenario: "Cannot `$::bin new` without logging in" {
    77    send "$::bin new\r"
    78    expect {
    79      timeout { handle_timeout; break }
    80      "You need to log in before using \"lcp new\"."
    81    }
    82    expect {
    83      timeout { handle_timeout; break }
    84      "Open your browser and authenticate?"
    85    }
    86    send "n\r"
    87    expect {
    88      timeout { handle_timeout; break }
    89      "Login canceled."
    90    }
    91  }
    92  
    93  Scenario: "Cannot delete without logging in" {
    94    send "$::bin delete\r"
    95    expect {
    96      timeout { handle_timeout; break }
    97      "You need to log in before using \"lcp delete\"."
    98    }
    99    expect {
   100      timeout { handle_timeout; break }
   101      "Open your browser and authenticate?"
   102    }
   103    send "n\r"
   104    expect {
   105      timeout { handle_timeout; break }
   106      "Login canceled."
   107    }
   108  }
   109  
   110  Scenario: "Cannot `$::bin domain` without logging in" {
   111    send "$::bin domain\r"
   112    expect {
   113      timeout { handle_timeout; break }
   114      "You need to log in before using \"lcp domain\"."
   115    }
   116    expect {
   117      timeout { handle_timeout; break }
   118      "Open your browser and authenticate?"
   119    }
   120    send "n\r"
   121    expect {
   122      timeout { handle_timeout; break }
   123      "Login canceled."
   124    }
   125  }
   126  
   127  Scenario: "Cannot `$::bin env-var` without logging in" {
   128    send "$::bin env-var\r"
   129    expect {
   130      timeout { handle_timeout; break }
   131      "You need to log in before using \"lcp env-var\"."
   132    }
   133    expect {
   134      timeout { handle_timeout; break }
   135      "Open your browser and authenticate?"
   136    }
   137    send "n\r"
   138    expect {
   139      timeout { handle_timeout; break }
   140      "Login canceled."
   141    }
   142  }
   143  
   144  Scenario: "Cannot `$::bin scale` without logging in" {
   145    send "$::bin scale\r"
   146    expect {
   147      timeout { handle_timeout; break }
   148      "You need to log in before using \"lcp scale\"."
   149    }
   150    expect {
   151      timeout { handle_timeout; break }
   152      "Open your browser and authenticate?"
   153    }
   154    send "n\r"
   155    expect {
   156      timeout { handle_timeout; break }
   157      "Login canceled."
   158    }
   159  }
   160  
   161  Scenario: "Cannot `$::bin shell` without logging in" {
   162    send "$::bin shell\r"
   163    expect {
   164      timeout { handle_timeout; break }
   165      "You need to log in before using \"lcp shell\"."
   166    }
   167    expect {
   168      timeout { handle_timeout; break }
   169      "Open your browser and authenticate?"
   170    }
   171    send "n\r"
   172    expect {
   173      timeout { handle_timeout; break }
   174      "Login canceled."
   175    }
   176  }