Instead of popByName(), I think we want a slightly different behaviour from the current pop(). I think we want a restore(config_data_name), which makes the named ConfigData the top of the stack, the items that were above it are lost. This feature makes it easier to restore the config to a known state. There are two cases for this:
1. A layer pushes a marker config onto the overlays so that it can be
restored for the next test.
layer -> config.push('pagetestlayer', '')
test -> config.push('test data', test_data)
test -> config.push('test data 2', test_data_2)
layer -> config.restore('pagetestlayer')
2. A test saves the name of the top config_data to restore it. starting_state = config.overlays[0].name
... lots of config.push() calls config.restore(starting_state)
I agree that seeing a error at 3 would be best.
Instead of popByName(), I think we want a slightly different behaviour from the current pop(). I think we want a restore( config_ data_name) , which makes the named ConfigData the top of the stack, the items that were above it are lost. This feature makes it easier to restore the config to a known state. There are two cases for this:
1. A layer pushes a marker config onto the overlays so that it can be push('pagetestl ayer', '') restore( 'pagetestlayer' )
restored for the next test.
layer -> config.
test -> config.push('test data', test_data)
test -> config.push('test data 2', test_data_2)
layer -> config.
2. A test saves the name of the top config_data to restore it.
starting_ state = config. overlays[ 0].name
config. restore( starting_ state)
... lots of config.push() calls