The secret is to cook the beans until they’re almost tender. They should still have a crunchy, slightly firm bite after boiling for about 5 minutes. Overcooking the green beans will lead to a mushy casserole.