Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace repeating code for libyui press_next function by inheriting code from NavigationBase #13291

Merged
merged 2 commits into from Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Installation/AddOnProduct/AddOnProductPage.pm
Expand Up @@ -12,7 +12,7 @@
# Maintainer: QE YaST <qa-sle-yast@suse.de>

package Installation::AddOnProduct::AddOnProductPage;
use parent 'Installation::Navigation::NavigationBar';
use parent 'Installation::Navigation::NavigationBase';
use strict;
use warnings;

Expand Down
Expand Up @@ -13,7 +13,7 @@
# Maintainer: QE YaST <qa-sle-yast@suse.de>

package Installation::AddOnProductInstallation::AddOnProductInstallationPage;
use parent 'Installation::Navigation::NavigationBar';
use parent 'Installation::Navigation::NavigationBase';
use strict;
use warnings;

Expand Down
3 changes: 1 addition & 2 deletions lib/Installation/License/LicenseAgreementPage.pm
Expand Up @@ -11,7 +11,7 @@
# Maintainer: QE YaST <qa-sle-yast@suse.de>

package Installation::License::LicenseAgreementPage;
use parent 'Installation::Navigation::NavigationBar';
use parent 'Installation::Navigation::NavigationBase';
use strict;
use warnings;

Expand All @@ -26,7 +26,6 @@ sub new {
sub init {
my ($self, $args) = @_;
$self->SUPER::init($args);
$self->{btn_next} = $self->{app}->button({id => 'next'});
$self->{cb_language} = $self->{app}->combobox($args->{cb_language_filter});
$self->{rt_eula} = $self->{app}->richtext($args->{rt_eula_filter});
return $self;
Expand Down
2 changes: 1 addition & 1 deletion lib/Installation/ModuleSelection/ModuleSelectionPage.pm
Expand Up @@ -12,7 +12,7 @@
# Maintainer: QE YaST <qa-sle-yast@suse.de>

package Installation::ModuleSelection::ModuleSelectionPage;
use parent 'Installation::Navigation::NavigationBar';
use parent 'Installation::Navigation::NavigationBase';
use strict;
use warnings;

Expand Down
Expand Up @@ -7,10 +7,10 @@
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.

# Summary: Handles Navigation bar
# Summary: Handles Navigation base
# Maintainer: QE YaST <qa-sle-yast@suse.de>

package Installation::Navigation::NavigationBar;
package Installation::Navigation::NavigationBase;
use strict;
use warnings;

Expand Down
10 changes: 5 additions & 5 deletions lib/Installation/Navigation/NavigationController.pm
Expand Up @@ -14,7 +14,7 @@ package Installation::Navigation::NavigationController;
use strict;
use warnings;
use YuiRestClient;
use Installation::Navigation::NavigationBar;
use Installation::Navigation::NavigationBase;

sub new {
my ($class, $args) = @_;
Expand All @@ -24,18 +24,18 @@ sub new {

sub init {
my ($self) = @_;
$self->{NavigationBar} = Installation::Navigation::NavigationBar->new({app => YuiRestClient::get_app()});
$self->{NavigationBase} = Installation::Navigation::NavigationBase->new({app => YuiRestClient::get_app()});
return $self;
}

sub get_navigation_bar {
sub get_navigation_base {
my ($self) = @_;
return $self->{NavigationBar};
return $self->{NavigationBase};
}

sub proceed_next_screen {
my ($self) = @_;
$self->get_navigation_bar()->press_next();
$self->get_navigation_base()->press_next();
}

1;
Expand Up @@ -14,13 +14,14 @@
# Maintainer: QE YaST <qa-sle-yast@suse.de>

package Installation::Partitioner::LibstorageNG::v4_3::AbstractSizePage;
use parent 'Installation::Navigation::NavigationBase';
use strict;
use warnings;

sub init {
my $self = shift;
$self->SUPER::init();
$self->{rb_custom_size} = $self->{app}->radiobutton({id => 'custom_size'});
$self->{btn_next} = $self->{app}->button({id => 'next'});
return $self;
}

Expand All @@ -33,9 +34,4 @@ sub set_custom_size {
$self->press_next();
}

sub press_next {
my ($self) = @_;
$self->{btn_next}->click();
}

1;
Expand Up @@ -11,6 +11,7 @@
# Maintainer: QE YaST <qa-sle-yast@suse.de>

package Installation::Partitioner::LibstorageNG::v4_3::AddLogicalVolumePage;
use parent 'Installation::Navigation::NavigationBase';
use strict;
use warnings;
use testapi;
Expand All @@ -27,10 +28,10 @@ sub new {

sub init {
my $self = shift;
$self->SUPER::init();
$self->{tb_lv_name} = $self->{app}->textbox({id => '"Y2Partitioner::Dialogs::LvmLvInfo::NameWidget"'});
$self->{rb_thin_pool} = $self->{app}->radiobutton({id => 'thin_pool'});
$self->{rb_thin_volume} = $self->{app}->radiobutton({id => 'thin'});
$self->{btn_next} = $self->{app}->button({id => 'next'});
return $self;
}

Expand All @@ -48,9 +49,4 @@ sub select_type {
return $types{$type}->select();
}

sub press_next {
my ($self) = @_;
$self->{btn_next}->click();
}

1;
Expand Up @@ -11,6 +11,7 @@
# Maintainer: QE YaST <qa-sle-yast@suse.de>

package Installation::Partitioner::LibstorageNG::v4_3::AddVolumeGroupPage;
use parent 'Installation::Navigation::NavigationBase';
use strict;
use warnings;

Expand All @@ -27,8 +28,7 @@ sub new {

sub init {
my $self = shift;

$self->{btn_next} = $self->{app}->button({id => 'next'});
$self->SUPER::init();
$self->{btn_add} = $self->{app}->button({id => 'add'});
$self->{btn_add_all} = $self->{app}->button({id => 'add_all'});
$self->{txtbox_vg_name} = $self->{app}->textbox({id => '"Y2Partitioner::Dialogs::LvmVg::NameWidget"'});
Expand All @@ -48,11 +48,6 @@ sub press_add_button {
return $self->{btn_add}->click();
}

sub press_next_button {
my ($self) = @_;
return $self->{btn_next}->click();
}

sub select_available_device {
my ($self, $device) = @_;
return $self->{tbl_available_devices}->select(value => $device);
Expand Down
Expand Up @@ -12,6 +12,7 @@
# Maintainer: QE YaST <qa-sle-yast@suse.de>

package Installation::Partitioner::LibstorageNG::v4_3::CreatePartitionTablePage;
use parent 'Installation::Navigation::NavigationBase';
use strict;
use warnings;

Expand All @@ -27,17 +28,12 @@ sub new {

sub init {
my $self = shift;
$self->SUPER::init();
$self->{rb_msdos_part_table} = $self->{app}->radiobutton({id => '"msdos"'});
$self->{rb_gpt_part_table} = $self->{app}->radiobutton({id => '"gpt"'});
$self->{btn_next} = $self->{app}->button({id => 'next'});
return $self;
}

sub press_next {
my ($self) = @_;
return $self->{btn_next}->click();
}

sub select_partition_table_type {
my ($self, $table_type) = @_;
return ($table_type eq 'msdos') ? $self->{rb_msdos_part_table}->select() : $self->{rb_gpt_part_table}->select();
Expand Down
Expand Up @@ -11,6 +11,7 @@
# Maintainer: QE YaST <qa-sle-yast@suse.de>

package Installation::Partitioner::LibstorageNG::v4_3::EncryptPartitionPage;
use parent 'Installation::Navigation::NavigationBase';
use strict;
use warnings;

Expand All @@ -24,9 +25,9 @@ sub new {

sub init {
my $self = shift;
$self->SUPER::init();
$self->{tb_pass} = $self->{app}->textbox({id => 'pw1'});
$self->{tb_pass_reenter} = $self->{app}->textbox({id => 'pw2'});
$self->{btn_next} = $self->{app}->button({id => 'next'});
return $self;
}

Expand All @@ -47,9 +48,4 @@ sub reenter_password {
return $self->{tb_pass_reenter}->set($password);
}

sub press_next {
my ($self) = @_;
return $self->{btn_next}->click();
}

1;
Expand Up @@ -401,7 +401,7 @@ sub add_volume_group {
$self->get_add_volume_group_page()->select_available_device($device);
}
$self->get_add_volume_group_page()->press_add_button();
$self->get_add_volume_group_page()->press_next_button();
$self->get_add_volume_group_page()->press_next();
}

sub delete_volume_group {
Expand Down Expand Up @@ -629,8 +629,8 @@ sub decline_warning {

sub show_summary_and_accept_changes {
my ($self) = @_;
$self->get_expert_partitioner_page()->press_next_button();
$self->get_summary_page()->press_next_button();
$self->get_expert_partitioner_page()->press_next();
$self->get_summary_page()->press_next();
sofiasyria marked this conversation as resolved.
Show resolved Hide resolved
}

sub confirm_only_use_if_familiar {
Expand Down
Expand Up @@ -15,6 +15,7 @@ package Installation::Partitioner::LibstorageNG::v4_3::ExpertPartitionerPage;
use strict;
use warnings;
use testapi;
use parent 'Installation::Navigation::NavigationBase';
use parent 'Installation::Partitioner::LibstorageNG::ExpertPartitionerPage';

sub new {
Expand All @@ -28,7 +29,7 @@ sub new {

sub init {
my $self = shift;

$self->SUPER::init();
$self->{btn_add_partition} = $self->{app}->button({id => '"Y2Partitioner::Widgets::PartitionAddButton"'});
$self->{btn_edit_partition} = $self->{app}->button({id => '"Y2Partitioner::Widgets::BlkDeviceEditButton"'});
$self->{btn_delete_partition} = $self->{app}->button({id => '"Y2Partitioner::Widgets::PartitionDeleteButton"'});
Expand All @@ -43,7 +44,6 @@ sub init {
$self->{tbl_lvm_devices} = $self->{app}->table({id => '"Y2Partitioner::Widgets::LvmDevicesTable"'});
$self->{tree_system_view} = $self->{app}->tree({id => '"Y2Partitioner::Widgets::OverviewTree"'});
$self->{btn_add_logical_volume} = $self->{app}->tree({id => '"Y2Partitioner::Widgets::LvmLvAddButton"'});
$self->{btn_next} = $self->{app}->button({id => 'next'});

return $self;
}
Expand Down Expand Up @@ -137,11 +137,6 @@ sub press_cancel_button {
$self->{btn_cancel}->click();
}

sub press_next_button {
my ($self) = @_;
$self->{btn_next}->click();
}

sub select_disk {
my ($self, $disk) = @_;
$self->select_item_in_system_view_table('Hard Disks|' . $disk);
Expand Down
Expand Up @@ -13,6 +13,7 @@
# Maintainer: QE YaST <qa-sle-yast@suse.de>

package Installation::Partitioner::LibstorageNG::v4_3::FilesystemOptionsPage;
use parent 'Installation::Navigation::NavigationBase';
use strict;
use warnings;

Expand All @@ -26,9 +27,9 @@ sub new {

sub init {
my $self = shift;
$self->SUPER::init();
$self->{lbl_settings_root_part} = $self->{app}->label({label => 'Settings for the Root Partition'});
$self->{cb_root_fs_type} = $self->{app}->combobox({id => '"vol_0_fs_type"'});
$self->{btn_next} = $self->{app}->button({id => 'next'});
return $self;
}

Expand All @@ -51,9 +52,4 @@ sub is_shown {
return $self->{lbl_settings_root_part}->exist();
}

sub press_next {
my ($self) = @_;
$self->{btn_next}->click();
}

1;
Expand Up @@ -12,6 +12,7 @@
# Maintainer: QE YaST <qa-sle-yast@suse.de>

package Installation::Partitioner::LibstorageNG::v4_3::FormatMountOptionsPage;
use parent 'Installation::Navigation::NavigationBase';
use strict;
use warnings;
use YuiRestClient::Wait;
Expand All @@ -26,6 +27,7 @@ sub new {

sub init {
my $self = shift;
$self->SUPER::init();
$self->{cb_filesystem} = $self->{app}->combobox({id => '"Y2Partitioner::Widgets::BlkDeviceFilesystem"'});
$self->{cb_enable_snapshots} = $self->{app}->checkbox({id => '"Y2Partitioner::Widgets::Snapshots"'});
$self->{rb_format_device} = $self->{app}->radiobutton({id => 'format_device'});
Expand All @@ -34,7 +36,6 @@ sub init {
$self->{cb_mount_point} = $self->{app}->combobox({id => '"Y2Partitioner::Widgets::MountPoint"'});
$self->{rb_no_mount_device} = $self->{app}->radiobutton({id => 'dont_mount_device'});
$self->{cb_encrypt} = $self->{app}->checkbox({id => '"Y2Partitioner::Widgets::EncryptBlkDevice"'});
$self->{btn_next} = $self->{app}->button({id => 'next'});
$self->{btn_fstab_options} = $self->{app}->button({id => '"Y2Partitioner::Widgets::FstabOptionsButton"'});
return $self;
}
Expand Down Expand Up @@ -132,11 +133,6 @@ sub enter_mount_point {
return $self->{cb_mount_point}->set($mount_point);
}

sub press_next {
my ($self) = @_;
return $self->{btn_next}->click();
}

sub press_fstab_options {
my ($self) = @_;
return $self->{btn_fstab_options}->click();
Expand Down
Expand Up @@ -11,6 +11,7 @@
# Maintainer: QE YaST <qa-sle-yast@suse.de>

package Installation::Partitioner::LibstorageNG::v4_3::MsdosPartitionTypePage;
use parent 'Installation::Navigation::NavigationBase';
use strict;
use warnings;

Expand All @@ -24,7 +25,7 @@ sub new {

sub init {
my $self = shift;
$self->{btn_next} = $self->{app}->button({id => 'next'});
$self->SUPER::init();
$self->{rb_primary} = $self->{app}->radiobutton({id => '"primary"'});
$self->{rb_extended} = $self->{app}->radiobutton({id => '"extended"'});
return $self;
Expand All @@ -45,9 +46,4 @@ sub select_type {
return $types{$type}->select();
}

sub press_next {
my ($self) = @_;
return $self->{btn_next}->click();
}

1;