Skip to content

Commit

Permalink
Replace repeating libyui press_next with NavigationBase
Browse files Browse the repository at this point in the history
  • Loading branch information
sofiasyria committed Sep 20, 2021
1 parent c5f8cbf commit 7d70912
Show file tree
Hide file tree
Showing 24 changed files with 47 additions and 141 deletions.
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 @@ -630,7 +630,7 @@ 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_summary_page()->press_next();
}

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

sub new {
my ($class, $args) = @_;
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;
Expand Up @@ -12,6 +12,7 @@
# Maintainer: QE YaST <qa-sle-yast@suse.de>

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

Expand All @@ -25,8 +26,8 @@ sub new {

sub init {
my $self = shift;
$self->SUPER::init();
$self->{cb_enable_lvm} = $self->{app}->combobox({id => 'lvm'});
$self->{btn_next} = $self->{app}->button({id => 'next'});
return $self;
}

Expand All @@ -35,9 +36,4 @@ sub is_shown {
return $self->{cb_enable_lvm}->exist();
}

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::RaidOptionsPage;
use parent 'Installation::Navigation::NavigationBase';
use strict;
use warnings;
use testapi;
Expand All @@ -27,7 +28,7 @@ sub new {

sub init {
my $self = shift;
$self->{btn_next} = $self->{app}->button({id => 'next'});
$self->SUPER::init();
$self->{cb_chunk_size} = $self->{app}->combobox({id => '"Y2Partitioner::Dialogs::MdOptions::ChunkSize"'});

return $self;
Expand All @@ -38,9 +39,4 @@ sub select_chunk_size {
$self->{cb_chunk_size}->select($chunk_size);
}

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::RaidTypePage;
use parent 'Installation::Navigation::NavigationBase';
use strict;
use warnings;
use testapi;
Expand All @@ -27,7 +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'});

Expand Down Expand Up @@ -55,11 +56,6 @@ sub press_add_all_button {
return $self->{btn_add_all}->click();
}

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

sub set_raid_level {
my ($self, $raid_level) = @_;

Expand Down
8 changes: 2 additions & 6 deletions lib/Installation/Partitioner/LibstorageNG/v4_3/RolePage.pm
Expand Up @@ -12,6 +12,7 @@
# Maintainer: QE YaST <qa-sle-yast@suse.de>

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

Expand All @@ -25,12 +26,12 @@ sub new {

sub init {
my $self = shift;
$self->SUPER::init();
$self->{rb_operating_system} = $self->{app}->radiobutton({id => 'system'});
$self->{rb_data_isv_apps} = $self->{app}->radiobutton({id => 'data'});
$self->{rb_swap} = $self->{app}->radiobutton({id => 'swap'});
$self->{rb_efi_boot_part} = $self->{app}->radiobutton({id => 'efi_boot'});
$self->{rb_raw_volume} = $self->{app}->radiobutton({id => 'raw'});
$self->{btn_next} = $self->{app}->button({id => 'next'});
return $self;
}

Expand All @@ -54,9 +55,4 @@ sub select_role {
"Avalaible options: operating-system, data, swap, efi-boot, raw-volume";
}

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

1;

0 comments on commit 7d70912

Please sign in to comment.