mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-13 21:05:30 +02:00
I'm adding an explicit delay between moving the commits and selecting the next items because otherwise it happens too fast
62 lines
1.6 KiB
Go
62 lines
1.6 KiB
Go
package demo
|
|
|
|
import (
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
|
)
|
|
|
|
var InteractiveRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
|
Description: "Interactive rebase",
|
|
ExtraCmdArgs: []string{"log"},
|
|
Skip: false,
|
|
IsDemo: true,
|
|
SetupConfig: func(config *config.AppConfig) {
|
|
setDefaultDemoConfig(config)
|
|
},
|
|
SetupRepo: func(shell *Shell) {
|
|
shell.CreateRepoHistory()
|
|
|
|
shell.NewBranch("feature/demo")
|
|
|
|
shell.CreateNCommitsWithRandomMessages(10)
|
|
|
|
shell.CloneIntoRemote("origin")
|
|
|
|
shell.SetBranchUpstream("feature/demo", "origin/feature/demo")
|
|
},
|
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
|
t.SetCaptionPrefix("Interactive rebase")
|
|
t.Wait(1000)
|
|
|
|
t.Views().Commits().
|
|
IsFocused().
|
|
Press(keys.Commits.StartInteractiveRebase).
|
|
PressFast(keys.Universal.RangeSelectDown).
|
|
PressFast(keys.Universal.RangeSelectDown).
|
|
Press(keys.Commits.MarkCommitAsFixup).
|
|
PressFast(keys.Commits.MoveDownCommit).
|
|
PressFast(keys.Commits.MoveDownCommit).
|
|
Delay().
|
|
SelectNextItem().
|
|
SelectNextItem().
|
|
Press(keys.Universal.Remove).
|
|
SelectNextItem().
|
|
Press(keys.Commits.SquashDown).
|
|
Press(keys.Universal.CreateRebaseOptionsMenu).
|
|
Tap(func() {
|
|
t.ExpectPopup().Menu().
|
|
Title(Contains("Rebase options")).
|
|
Select(Contains("continue")).
|
|
Confirm()
|
|
}).
|
|
SetCaptionPrefix("Push to remote").
|
|
Press(keys.Universal.NextScreenMode).
|
|
Press(keys.Universal.Push).
|
|
Tap(func() {
|
|
t.ExpectPopup().Confirmation().
|
|
Title(Contains("Force push")).
|
|
Content(AnyString()).
|
|
Confirm()
|
|
})
|
|
},
|
|
})
|