Recent Posts

Featured image for User Story BDD Cucumber CRUD Operations Example

User Story BDD Cucumber CRUD Operations Example

Basic

gherkin
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
Feature: Create Employee

  Scenario: WITH ALL REQUIRED FIELDS IS SUCCESSFUL
  
    Given user wants to create an employee with the following attributes
      | id  | firstName | lastName | dateOfBirth | startDate  | employmentType | email               |
      | 100 | Rachel    | Green    | 1990-01-01  | 2018-01-01 | Permanent      | rachel.green@fs.com |

    And with the following phone numbers
      | id  | type   | isdCode | phoneNumber | extension |
      | 102 | Mobile | +1      | 2141112222  |           |
      | 103 | Office | +1      | 8362223000  | 333       |

    When user saves the new employee 'WITH ALL REQUIRED FIELDS'
    Then the save 'IS SUCCESSFUL'

Create Employee

gherkin
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Feature: Create Employee

  Scenario Outline: <testCase> <expectedResult>

    Given user wants to create an employee with the following attributes
      | id  | firstName   | lastName   | dateOfBirth   | startDate   | employmentType   | email   |
      | 110 | <firstName> | <lastName> | <dateOfBirth> | <startDate> | <employmentType> | <email> |

    And with the following phone numbers
      | id  | type   | isdCode | phoneNumber | extension |
      | 111 | Mobile | +1      | 2141112222  |           |
      | 112 | Office | +1      | 8362223000  | 333       |

    When user saves the new employee '<testCase>'
    Then the save '<expectedResult>'

    Examples:
      | testCase                 | expectedResult | firstName | lastName | dateOfBirth | startDate  | employmentType | email               |
      | WITHOUT FIRST NAME       | FAILS          |           | Green    | 1990-01-01  | 2018-01-01 | Permanent      | rachel.green@fs.com |
      | WITHOUT LAST NAME        | FAILS          | Rachel    |          | 1990-01-01  | 2018-01-01 | Permanent      | rachel.green@fs.com |
      | WITHOUT DATE OF BIRTH    | FAILS          | Rachel    | Green    |             | 2018-01-01 | Permanent      | rachel.green@fs.com |
      | WITHOUT START DATE       | FAILS          | Rachel    | Green    | 1990-01-01  |            | Permanent      | rachel.green@fs.com |
      | WITHOUT EMPLOYMENT TYPE  | FAILS          | Rachel    | Green    | 1990-01-01  | 2018-01-01 |                | rachel.green@fs.com |
      | WITHOUT EMAIL            | FAILS          | Rachel    | Green    | 1990-01-01  | 2018-01-01 | Permanent      |                     |
      | WITH ALL REQUIRED FIELDS | IS SUCCESSFUL  | Rachel    | Green    | 1990-01-01  | 2018-01-01 | Permanent      | rachel.green@fs.com |

Get Employee

gherkin
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Feature: Get Employee

  Background:

    Given an employee with the following attributes
      | id  | firstName | lastName | dateOfBirth | startDate  | employmentType | email               |
      | 200 | Rachel    | Green    | 1990-01-01  | 2018-01-01 | Permanent      | rachel.green@fs.com |

    And with the following phone numbers
      | id  | type   | isdCode | phoneNumber | extension |
      | 201 | Mobile | +1      | 2141112222  |           |
      | 202 | Office | +1      | 8362223000  | 333       |

    When employee already exists


  Scenario: GET BY ID

    When user wants to get employee by id 200
    Then the get 'IS SUCCESSFUL'
    
    And following employee is returned
      | id  | firstName | lastName | dateOfBirth | startDate  | employmentType | email               |
      | 200 | Rachel    | Green    | 1990-01-01  | 2018-01-01 | Permanent      | rachel.green@fs.com |

    And following employee phone numbers are returned
      | id  | type   | isdCode | phoneNumber | extension |
      | 201 | Mobile | +1      | 2141112222  |           |
      | 202 | Office | +1      | 8362223000  | 333       |

Update Employee

gherkin
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Feature: Update Employee

  Background:

    Given an employee with the following attributes
      | id  | firstName | lastName | dateOfBirth | startDate  | employmentType | email               |
      | 300 | Rachel    | Green    | 1990-01-01  | 2018-01-01 | Permanent      | rachel.green@fs.com |

    And with the following phone numbers
      | id  | type   | isdCode | phoneNumber | extension |
      | 301 | Mobile | +1      | 2141112222  |           |
      | 302 | Office | +1      | 8362223000  | 333       |

    When employee already exists


  Scenario Outline: <testCase> <expectedResult>

    Given user wants to update an employee with the following attributes
      | id   | firstName   | lastName   | dateOfBirth   | startDate   | employmentType   | email   |
      | <id> | <firstName> | <lastName> | <dateOfBirth> | <startDate> | <employmentType> | <email> |

    And with the following phone numbers
      | id  | type   | isdCode | phoneNumber | extension |
      | 301 | Mobile | +1      | 2141112222  |           |
      | 302 | Office | +1      | 8362223000  | 333       |

    When user saves the employee '<testCase>'
    Then the save '<expectedResult>'

    Examples:
      | testCase                 | expectedResult | id  | firstName | lastName | dateOfBirth | startDate  | employmentType | email               |
      | WITHOUT ID               | FAILS          |     | Rachel    | Green    | 1990-01-01  | 2018-01-01 | Permanent      | rachel.green@fs.com |
      | WITHOUT FIRST NAME       | FAILS          | 300 |           | Green    | 1990-01-01  | 2018-01-01 | Permanent      | rachel.green@fs.com |
      | WITHOUT LAST NAME        | FAILS          | 300 | Rachel    |          | 1990-01-01  | 2018-01-01 | Permanent      | rachel.green@fs.com |
      | WITHOUT DATE OF BIRTH    | FAILS          | 300 | Rachel    | Green    |             | 2018-01-01 | Permanent      | rachel.green@fs.com |
      | WITHOUT START DATE       | FAILS          | 300 | Rachel    | Green    | 1990-01-01  |            | Permanent      | rachel.green@fs.com |
      | WITHOUT EMPLOYMENT TYPE  | FAILS          | 300 | Rachel    | Green    | 1990-01-01  | 2018-01-01 |                | rachel.green@fs.com |
      | WITHOUT EMAIL            | FAILS          | 300 | Rachel    | Green    | 1990-01-01  | 2018-01-01 | Permanent      |                     |
      | WITH ALL REQUIRED FIELDS | IS SUCCESSFUL  | 300 | Rachel    | Green    | 1990-01-01  | 2018-01-01 | Permanent      | rachel.green@fs.com |

Delete Employee

gherkin
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
Feature: Delete Employee

  Background:

    Given an employee with the following attributes
      | id  | firstName | lastName | dateOfBirth | startDate  | employmentType | email               |
      | 400 | Rachel    | Green    | 1990-01-01  | 2018-01-01 | Permanent      | rachel.green@fs.com |

    And with the following phone numbers
      | id  | type   | isdCode | phoneNumber | extension |
      | 401 | Mobile | +1      | 2141112222  |           |
      | 402 | Office | +1      | 8362223000  | 333       |

    When employee already exists


  Scenario: DELETE BY ID

    When user wants to delete employee by id 400
    Then the delete 'IS SUCCESSFUL'

References

Featured image for Troubleshooting Mouse Scrolling In Tmux Sessions On Iterm2

Troubleshooting Mouse Scrolling In Tmux Sessions On Iterm2

If you’re experiencing issues with mouse scrolling in your Tmux sessions on iTerm2, you can follow these steps to troubleshoot and resolve the problem:

  1. Check iTerm2 Setting: Make sure that the “Scroll wheels send arrow keys when in alternate screen mode” option is enabled in iTerm2. You can find this setting in iTerm2’s preferences. Go to iTerm2 > Preferences > Advanced, and ensure that the “Scroll wheels send arrow keys…” option is set to “Yes.”

  2. Configure Tmux Plugins: To enhance mouse support in Tmux, you can use the tmux-plugins/tpm and nhdaly/tmux-better-mouse-mode plugins. These plugins enable better mouse interaction within Tmux sessions.

    Add the following lines to your ~/.tmux.conf file:

    bash
    1
    2
    3
    
    set -g @plugin 'tmux-plugins/tpm'
    set -g @plugin 'nhdaly/tmux-better-mouse-mode'
    set -g @emulate-scroll-for-no-mouse-alternate-buffer "on"

    This configuration sets up the necessary plugins and ensures that mouse scrolling works even when the alternate buffer is active.

  3. Install Tmux Plugin Manager (TPM): If you haven’t already, install the Tmux Plugin Manager (TPM) by running the following command in your terminal:

    bash
    1
    
    git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
  4. Reload Tmux Configuration: After adding the plugin configuration to your ~/.tmux.conf, you need to reload your Tmux configuration. You can do this from within a Tmux session by pressing Prefix (usually Ctrl-b by default) and then typing:

    bash
    1
    
    :source-file ~/.tmux.conf
  5. Install Plugins: Inside your Tmux session, activate TPM by pressing your Tmux prefix key (e.g., Ctrl-b) followed by I (capital “i”) to install the configured plugins.

    bash
    1
    
    <Prefix> + I

    TPM will download and install the plugins you specified in your ~/.tmux.conf file.

  6. Restart Tmux: To ensure the changes take effect, you can either restart your Tmux session or create a new one.

Featured image for Enable Read Input When Debugging Golang on Visual Studio Code

Enable Read Input When Debugging Golang on Visual Studio Code

It looks like you’re trying to set up debugging for a Golang application in Visual Studio Code, specifically focusing on enabling input reading during debugging. The configuration you’ve provided involves using the launch.json and task.json files to set up the debugger and tasks for your project.

Here’s a breakdown of the configuration you’ve shared:

launch.json Configuration

In this configuration, you’re defining a launch configuration to connect to a remote server for debugging. Here are the key attributes:

Featured image for Wordpress Center Align Block Widget on Footer Widget

Wordpress Center Align Block Widget on Footer Widget

To center align a block widget in the footer of a WordPress website, you can use custom CSS code. Here’s how you can do it:

  1. Access Your WordPress Dashboard: Log in to your WordPress admin dashboard.

  2. Navigate to the Customizer: In the dashboard, go to “Appearance” and then click on “Customize.”

  3. Open Additional CSS: Look for the “Additional CSS” option in the Customizer menu. This is where you can add your custom CSS code.

  4. Add the Custom CSS: Paste the following CSS code into the “Additional CSS” box:

Featured image for Automate Your VirtualBox VMs with Autostart

Automate Your VirtualBox VMs with Autostart

This guide will walk you through setting up a system service to automatically launch your desired VirtualBox VMs, saving you precious time and effort.

Configure Autostart Properties

  • Create a file named autostart.properties in the folder C:\Users\Admin\.VirtualBox.
  • Inside the file, define the following:
properties
1
2
3
4
5
default_policy = deny
Admin = {
    allow = true
    startup_delay = 10
}
  • default_policy = deny: This sets the default policy to deny all autostarts.
  • Admin = { allow = true; startup_delay = 10 }: This allows the user “Admin” to start VMs with a 10-second delay.

Set System Variable

  • Create a new system variable named VBOXAUTOSTART_CONFIG and set its value to C:\Users\Admin\.VirtualBox\autostart.properties.

Install the VirtualBox Autostart Service

  • Navigate to the VirtualBox installation directory: cd "C:\Program Files\Oracle\VirtualBox"
  • Run the following commands:
batch
1
2
.\VBoxAutostartSvc.exe install --user=Admin
.\VBoxManage.exe modifyvm "virtual-pc" --autostart-enabled on
  • Replace "virtual-pc" with the actual name of your VM you want to autostart.

Check and Start the Service

  • Use the sc command to check the service status: sc query VBoxAutostartSvcadmin-pcadmin
  • Start the service: sc start VirtualBox Autostart Service VBoxAutostartSvcadmin-pcadmin

Congratulations! Your VirtualBox VM is now set to autostart when your system boots.