Skip to content

Commit

Permalink
Merge pull request #213 from woocommerce/24-10/woocommerce-as-activat…
Browse files Browse the repository at this point in the history
…ion-sut

Allow to use WooCommerce as the SUT for Activation Test
  • Loading branch information
Luc45 authored Oct 4, 2024
2 parents e84cebd + 29f7920 commit 29de747
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Binary file modified qit
Binary file not shown.
18 changes: 12 additions & 6 deletions src/src/Commands/RunActivationTestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use QIT_CLI\App;
use QIT_CLI\Cache;
use QIT_CLI\Environment\Extension;
use QIT_CLI\OptionReuseTrait;
use QIT_CLI\Commands\CustomTests\RunE2ECommand;
use QIT_CLI\RequestBuilder;
Expand Down Expand Up @@ -76,10 +77,6 @@ protected function execute( InputInterface $input, OutputInterface $output ): in

$run_e2e_options = [];

// Sut.
$run_e2e_options['woo_extension'] = $input->getArgument( 'woo_extension' );

$run_e2e_options['--sut_action'] = 'activate';
$run_e2e_options['--pw_options'] = '--retries=0';
$run_e2e_options['--skip_activating_plugins'] = true;

Expand All @@ -98,8 +95,17 @@ protected function execute( InputInterface $input, OutputInterface $output ): in
$run_e2e_options['--source'] = $input->getOption( 'zip' );
}

// Set the test.
$run_e2e_options['--plugin'][] = 'woocommerce:test:activation';
$sut = $input->getArgument( 'woo_extension' );

if ( $sut !== 'woocommerce' ) {
$run_e2e_options['--sut_action'] = Extension::ACTIONS['activate'];
$run_e2e_options['woo_extension'] = $input->getArgument( 'woo_extension' );
$run_e2e_options['--plugin'][] = 'woocommerce:test:activation';
} else {
$run_e2e_options['woo_extension'] = 'woocommerce';
$run_e2e_options['test'] = 'activation';
$run_e2e_options['--sut_action'] = Extension::ACTIONS['test'];
}

if ( $output->isVerbose() ) {
$run_e2e_options['--verbose'] = true;
Expand Down

0 comments on commit 29de747

Please sign in to comment.